Thank you, Per, The problem really lies in the debugger.
Best regards, Alexey > -----Original Message----- > From: Per Östlund [mailto:[email protected]] > Sent: den 17 november 2010 12:49 > To: [email protected] > Cc: Alexey Lebedev > Subject: Re: Strange behavior of SCodeUtil.translateAnnotations > > 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; > >
