Skip to content

Commit

Permalink
Specify how to handle modifier lists.
Browse files Browse the repository at this point in the history
Give example.

Rename to be slightly better.

Quoting!

Type Modelica keywords in bold and remove trailing whitespaces ;-)
  • Loading branch information
HansOlsson committed Jan 11, 2024
1 parent f35bfd9 commit f2cccab
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Modelica/package.mo
Expand Up @@ -1314,8 +1314,35 @@ The keywords <code>public</code> and <code>protected</code> are headings for a&n
of declarations.
</p>
<p>
Long modifier lists shall be split into several indented lines with at most one modifier per line.
</p>
<p>
Full class definitions shall be separated by an empty line.
</p>

<h5>Example</h5>

<blockquote><pre>
<strong>package</strong> MyPackage
<strong>partial</strong> <strong>model</strong> BaseModel
<strong>parameter</strong> Real p;
<strong>input</strong> Real u(unit=\"m/s\");
<strong>protected</strong>
Real y;
Real x(
start=1,
unit=\"m\",
nominal=10);
<strong>equation</strong>
<strong>der</strong>(x) = u;
y = 2*x;
<strong>end</strong> BaseModel;

<strong>model</strong> ModelP2
<strong>extends</strong> BaseModel(p=2);
<strong>end</strong> ModelP2;
<strong>end</strong> MyPackage;
</pre></blockquote>
</html>"));
end Format;

Expand Down

0 comments on commit f2cccab

Please sign in to comment.