Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

omc allows annotation before element_list

omc allows annotation before element_list

Dear developers,

I have the following modelica program:

model M annotation (); Real v; end M;

Which produces:

$ omc M.mo
class M
  Real v;
end M;

However, according to the Modelica specivication 3.3, Appendix B.2, an annotation is never legal before an element_list.

Am I missing something or is this a bug of omc?

Sincerly yours,
Heinrich Hördegen

Re: omc allows annotation before element_list

It used to be allowed, so OpenModelica automatically moves it to the end of the class:

Code:

[martin@mega tmp]$ omc +d=showStatement a.mos

Evaluating: loadString("model M annotation (); Real v; end M;")
true
Evaluating: list()
"model M
  Real v;
  annotation;
end M;

"

Re: omc allows annotation before element_list

Also, you can use the +showAnnotations flag to have omc print out the annotations in the flat code, the default is to not print them.

There are 0 guests and 0 other users also viewing this topic
You are here: