-
Notifications
You must be signed in to change notification settings - Fork 43
Add restriction for time. #3790
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
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| All declared variables are functions of the independent variable \lstinline!time!. | ||
| The variable \lstinline!time! is a built-in variable available in all models and blocks, which is treated as an input variable. | ||
| The name \lstinline!time! is reserved and may not declared in any class. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the plan in #1243 (comment) was to make it a keyword? That still sounds like the clean way to do it; just add it to primary in the grammar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would be the alternative.
I see two minor issues:
- I'm not sure we want it syntax highlighted as a keyword in the specification.
- Describing its attributes (in particular its start-attribute - which may be useful for clocked semantics) becomes a bit messy, but by just stating that it corresponds to a variable defined as:... would likely work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
henrikt-ma
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whatever we do to resolve this, there needs to be some change under \cref{modelica-keywords}.
|
|
||
| In particular, it is not allowed to declare an element or enumeration literal with these names. | ||
| This also applies to the identifiers that name the predefined types \lstinline!Real!, \lstinline!Integer!, \lstinline!Boolean!, and \lstinline!String!, see \cref{predefined-types-and-classes}. | ||
| This also applies to the identifiers that name the predefined types \lstinline!Real!, \lstinline!Integer!, \lstinline!Boolean!, and \lstinline!String!, see \cref{predefined-types-and-classes}, and the variable \lstinline!time!, see \cref{built-in-variable-time}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is not the same "need" to treat time similar to Real, as there is only one trivial change needed in the grammar for time, whereas the builtin types would require a bit more. Hence, I think we should do time properly instead of expanding the non-keyword mess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, as far as I can see it was not entirely trivial - and since tool grammars are unlikely to exactly match the grammar in the specification there's a risk that something was missed.


Closes #1243