Hi Alexey,

I have no problems here, using latest SVN revision 7062. omc +showAnnotations on your test case gives:

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

Are you sure that the problems lies with omc, and not with the debugger? I have on occasion experienced that the debugger lies to me, and claims that a list is NIL when it isn't.

Cheers,
Per

On 2010-11-17 12:06, Alexey Lebedev wrote:
   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