diff --git a/parsimonyLibrary/dynamicObject.mc b/parsimonyLibrary/dynamicObject.mc index 04f60eb..a9ac778 100644 --- a/parsimonyLibrary/dynamicObject.mc +++ b/parsimonyLibrary/dynamicObject.mc @@ -117,7 +117,7 @@ typedef struct __oop *oop; nbTabs = 0; if (tabs != null) { nbTabs = tabs; } for (i = 0; i 0) { append(s.declarators.paramTypeL, newComma()); @@ -184,16 +184,16 @@ typedef struct __oop *oop; } tmp = {}; // @@ problem for variable changement - tmp[0] = makeln(`declaration struct @@(newId(string(program.objects.currentClassName), " ")) *self = (struct @@(newId(string(program.objects.currentClassName))) *) __self;, 1); + tmp[0] = makeln(`declaration struct @@(newId(program.objects.currentClassName, " ")) *self = (struct @@(newId(program.objects.currentClassName)) *) __self;, 1); s.compoundS.expression = treeCopy(fusion(tmp, s.compoundS.expression)); program.objects.function = "none"; return s; } /*********** Constructor function ************/ if (program.objects.function == "constructor") { - rawDeclaration = makeln(`declaration class = findClass(@@(newText("\"" + string(program.objects.currentClassName) + "\"")));, 1); + rawDeclaration = makeln(`declaration class = findClass(@@(newText("\"" + program.objects.currentClassName + "\"")));, 1); t = {}; - append(t, treeCopy(makeln(`declaration struct @@(newId(string(program.objects.currentClassName), " ")) *self = calloc(1, sizeof *self);, 1))); + append(t, treeCopy(makeln(`declaration struct @@(newId(program.objects.currentClassName, " ")) *self = calloc(1, sizeof *self);, 1))); // take the structure of self->foo lhs = treeCopy(s.compoundS.expression[0].expression.lhs); lhs.rhs = newId("class", " "); @@ -215,7 +215,7 @@ typedef struct __oop *oop; for (k in program.objects.class[i]) { linkedMethod = string(program.objects.class[i][k]); append(t, treeCopy(makeln(`declaration int @@(newId("_selector_" + linkedMethod)) = findSelector(@@(newId("\"" + linkedMethod + "\"")));, 1))); - castMethod = "(method_t) " + string(i) + "_" + string(program.objects.class[i][k]); + castMethod = "(method_t) " + className + "_" + linkedMethod; append(t, treeCopy(makeln(`declaration addMethod(@@(newId("_class_" + className)), @@(newId("_selector_" + linkedMethod)), @@(newId(castMethod)));, 1))); } }