Skip to content

Commit

Permalink
- getNamedAnnotation now works on overloaded functions
Browse files Browse the repository at this point in the history
- Improved rooted() description


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10749 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Dec 17, 2011
1 parent a2e5dae commit 694602a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
27 changes: 19 additions & 8 deletions Compiler/FrontEnd/ModelicaBuiltin.mo
Expand Up @@ -516,14 +516,25 @@ end cat;
function rooted "Not yet standard Modelica, but in the MSL since 3-4 years now."
external "builtin";
annotation(Documentation(info="<html>
<p>The operator \"rooted\" was introduced to improve efficiency:
A tool that constructs the graph with the Connections.branch/.root etc.
built-in operators has to cut the graph in order to arrive at \"spanning trees\".
If there is a statement \"Connections.branch(A,B)\", then \"rooted(A)\" returns true,
if \"A\" is closer to the root of the spanning tree as \"B\". Otherwise false is returned.
For the MultiBody library this allows to avoid unnecessary small linear systems of equations.
See <a href=\"https://trac.modelica.org/Modelica/ticket/95\">rooted ticket in the Modelica Trac</a>
</html>"));
<p><b>Not yet standard Modelica, but in the MSL since 3-4 years now.</b></p>
<h4>Syntax</h4>
<blockquote>
<pre><b>rooted</b>(<i>x</i>)</pre>
</blockquote>
<h4>Description</h4>
<p>The operator \"rooted\" was introduced to improve efficiency:
A tool that constructs the graph with the Connections.branch/.root etc.
built-in operators has to cut the graph in order to arrive at \"spanning trees\".
If there is a statement \"Connections.branch(A,B)\", then \"rooted(A)\" returns <pre>true</pre>,
if \"A\" is closer to the root of the spanning tree as \"B\". Otherwise <pre>false</pre> is returned.
For the MultiBody library this allows to avoid unnecessary small linear systems of equations.
</p>
<h4>Known Bugs</h4>
<p>
OpenModelica, <pre><b>rooted</b>(x)</pre> always returns <pre>true</pre>.
See <a href=\"https://trac.modelica.org/Modelica/ticket/95\">rooted ticket in the Modelica Trac</a> for details.
</p>
</html>"),version="Dymola / MSL 3");
end rooted;

function actualStream
Expand Down
6 changes: 6 additions & 0 deletions Compiler/Script/Interactive.mo
Expand Up @@ -13090,6 +13090,12 @@ algorithm
then
SOME(res);

case (Absyn.CLASS(body = Absyn.OVERLOAD(comment = SOME(Absyn.COMMENT(SOME(Absyn.ANNOTATION(annlst)),_)))),id,f)
equation
SOME(res) = getNamedAnnotationStr(annlst,id,f);
then
SOME(res);

else NONE();

end matchcontinue;
Expand Down

0 comments on commit 694602a

Please sign in to comment.