Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chapters/operatorsandexpressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ \subsection{Built-in Variable time}\label{built-in-variable-time}\indexinline{ti

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.
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

@henrikt-ma henrikt-ma Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally prefer that time does not look like any other identifier.

This is what we have today:
time-current

This is with time as a morekeywords=[1] (next to true and false):
time-keyword

Stating that time references a built-in variable defined as… sounds like a good approach to me.

It is implicitly defined as:
\begin{lstlisting}[language=modelica]
input Real time (final quantity = "Time",
Expand Down