Hi all,

 For some reason, I cannot get annotations translated from Absyn to SCode. 
Debugging shows that the problem lies in strange behavior of the functions 
SCodeUtil.translateAnnotations, translateAnnotationsEq, 
translateAnnotationsAlg. For example, translateAnnotations has following case:

    case(Absyn.ANNOTATIONITEM(ann) :: cdr)
      equation
        res = translateAnnotation(ann);
        anns = translateAnnotations(cdr);
        anns_1 = res :: anns;
      then
        anns_1;

If, for example, the input list consists of a single ANNOTATIONITEM (i.e., cdr 
is equal to NIL), and the line
        res = translateAnnotation(ann);
successfully returns some result, and then
        anns = translateAnnotations(cdr);
successfully returns NIL --- the value of anns_1 which is returned after that 
is, for some reason, also NIL! 

Has anybody observed such behavior? Does anybody know why it can happen?

 Best regards,
  Alexey Lebedev

P.S. A simple test case:

class C
  annotation(a=3);
  equation
  annotation(b=3);
end C;

Reply via email to