소스 검색

Update dynamicObject.mc

develop-theo
Theo Souchon 2 년 전
부모
커밋
28c32ae2db
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. +5
    -2
      parsimonyLibrary/dynamicObject.mc

+ 5
- 2
parsimonyLibrary/dynamicObject.mc 파일 보기

@ -184,7 +184,7 @@ typedef struct __oop *oop;
}
tmp = {};
// @@ problem for variable changement
tmp[0] = makeln(`declaration struct @@(newId(program.objects.currentClassName, " ")) *self = (struct @@(newId(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;
@ -209,12 +209,15 @@ typedef struct __oop *oop;
/*********** Main function ************/
if (s.declarators != null && s.declarators.declarators != null && string(s.declarators.declarators.identifier) == "main") {
t = {};
for(i in program.objects.methods) {
methodName = string(program.objects.methods[i]);
append(t, treeCopy(makeln(`declaration int @@(newId("_selector_" + methodName)) = findSelector(@@(newId("\"" + methodName + "\"")));, 1)));
}
for (i in program.objects.class) {
className = string(i); // can't work other way
append(t, treeCopy(makeln(`declaration int @@(newId("_class_" + className)) = findClass(@@(newId("\"" + className + "\"")));, 1)));
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) " + className + "_" + linkedMethod;
append(t, treeCopy(makeln(`declaration addMethod(@@(newId("_class_" + className)), @@(newId("_selector_" + linkedMethod)), @@(newId(castMethod)));, 1)));
}

불러오는 중...
취소
저장