Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotation position in class definition #1009

Closed
modelica-trac-importer opened this issue Nov 4, 2018 · 4 comments
Closed

Annotation position in class definition #1009

modelica-trac-importer opened this issue Nov 4, 2018 · 4 comments
Labels
bug Something isn't working

Comments

@modelica-trac-importer
Copy link
Collaborator

Reported by per.ostlund on 7 Mar 2013 11:38 UTC
If I understand the grammar correctly, it seems like it requires annotations in class definitions to be the last part of the composition. This seems to be followed by the MSL. Some of the examples in chapter 18 seems to imply otherwise though, such as the World example in 18.7 where the annotation is the first part of the composition. The tools that I've tried also allow class annotations to be placed anywhere inside a class. So either the grammar should be changed to allow this, or the examples in the specification needs to be fixed.


Migrated-From: https://trac.modelica.org/Modelica/ticket/1009

@modelica-trac-importer
Copy link
Collaborator Author

Comment by jmattsson on 7 Mar 2013 12:50 UTC
The grammar has been changed to only allow the annotation last. The examples should be updated.

@modelica-trac-importer
Copy link
Collaborator Author

Comment by per.ostlund on 7 Mar 2013 12:58 UTC
Ok, I see now that this is mentioned in the revision history. Besides the one in 18.7 I've also found such examples in 18.8.2 and 18.8.4, where ellipses are used to imply more content after the annotation.

@modelica-trac-importer
Copy link
Collaborator Author

Comment by stefanv on 7 Mar 2013 14:12 UTC
Many tools allow it to appear anywhere (or even in more than one location) because this was historically allowed (up to Modelica 2.2 if I remember correctly). Any examples that still follow this usage should be updated.

@modelica-trac-importer
Copy link
Collaborator Author

Comment by hansolsson on 31 Mar 2016 09:42 UTC
Updated examples to place annotations last (to not be misleading).
Some were already corrected as part of #1544 - but the rest should be done in r9238.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment