Skip to content

Commit 0ad152d

Browse files
committed
- Removed some cases for handling stringified crefs.
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12434 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 52e9811 commit 0ad152d

File tree

2 files changed

+16
-72
lines changed

2 files changed

+16
-72
lines changed

Compiler/BackEnd/BackendVariable.mo

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,59 +1780,23 @@ public function topLevelInput "function: topLevelInput
17801780
input DAE.VarDirection inVarDirection;
17811781
input DAE.ConnectorType inConnectorType;
17821782
algorithm
1783-
_ := matchcontinue (inComponentRef,inVarDirection,inConnectorType)
1784-
local
1785-
DAE.ComponentRef cr;
1786-
String name;
1787-
case ((cr as DAE.CREF_IDENT(ident = name)),DAE.INPUT(),_)
1788-
equation
1789-
{_} = Util.stringSplitAtChar(name, ".") "top level ident, no dots" ;
1790-
then
1791-
();
1792-
case (DAE.CREF_IDENT(ident = name),DAE.INPUT(),DAE.POTENTIAL()) /* Connector input variables at top level for crefs that are stringified */
1793-
equation
1794-
{_,_} = Util.stringSplitAtChar(name, ".");
1795-
then
1796-
();
1797-
case (DAE.CREF_IDENT(ident = name),DAE.INPUT(),DAE.FLOW())
1798-
equation
1799-
{_,_} = Util.stringSplitAtChar(name, ".");
1800-
then
1801-
();
1802-
/* For crefs that are not yet stringified, e.g. lower_known_var */
1803-
case (DAE.CREF_QUAL(ident = name,componentRef = DAE.CREF_IDENT(ident = _)),DAE.INPUT(),DAE.FLOW()) then ();
1804-
case ((cr as DAE.CREF_QUAL(ident = name,componentRef = DAE.CREF_IDENT(ident = _))),DAE.INPUT(),DAE.POTENTIAL()) then ();
1805-
end matchcontinue;
1783+
_ := match (inComponentRef,inVarDirection,inConnectorType)
1784+
case (DAE.CREF_IDENT(ident = _), DAE.INPUT(), _) then ();
1785+
case (DAE.CREF_QUAL(componentRef = DAE.CREF_IDENT(ident = _)), DAE.INPUT(), DAE.FLOW()) then ();
1786+
case (DAE.CREF_QUAL(componentRef = DAE.CREF_IDENT(ident = _)), DAE.INPUT(), DAE.POTENTIAL()) then ();
1787+
end match;
18061788
end topLevelInput;
18071789

18081790
protected function topLevelOutput
18091791
input DAE.ComponentRef inComponentRef;
18101792
input DAE.VarDirection inVarDirection;
18111793
input DAE.ConnectorType inConnectorType;
18121794
algorithm
1813-
_ := matchcontinue(inComponentRef, inVarDirection, inConnectorType)
1814-
local
1815-
DAE.ComponentRef cr;
1816-
String name;
1817-
case ((cr as DAE.CREF_IDENT(ident = name)),DAE.OUTPUT(),_)
1818-
equation
1819-
{_} = Util.stringSplitAtChar(name, ".") "top level ident, no dots" ;
1820-
then
1821-
();
1822-
case (DAE.CREF_IDENT(ident = name),DAE.OUTPUT(),DAE.POTENTIAL()) /* Connector input variables at top level for crefs that are stringified */
1823-
equation
1824-
{_,_} = Util.stringSplitAtChar(name, ".");
1825-
then
1826-
();
1827-
case (DAE.CREF_IDENT(ident = name),DAE.OUTPUT(),DAE.FLOW())
1828-
equation
1829-
{_,_} = Util.stringSplitAtChar(name, ".");
1830-
then
1831-
();
1832-
/* For crefs that are not yet stringified, e.g. lower_known_var */
1833-
case (DAE.CREF_QUAL(ident = name,componentRef = DAE.CREF_IDENT(ident = _)),DAE.OUTPUT(),DAE.FLOW()) then ();
1834-
case ((cr as DAE.CREF_QUAL(ident = name,componentRef = DAE.CREF_IDENT(ident = _))),DAE.OUTPUT(),DAE.POTENTIAL()) then ();
1835-
end matchcontinue;
1795+
_ := match(inComponentRef, inVarDirection, inConnectorType)
1796+
case (DAE.CREF_IDENT(ident = _), DAE.OUTPUT(), _) then ();
1797+
case (DAE.CREF_QUAL(componentRef = DAE.CREF_IDENT(ident = _)), DAE.OUTPUT(), DAE.FLOW()) then ();
1798+
case (DAE.CREF_QUAL(componentRef = DAE.CREF_IDENT(ident = _)), DAE.OUTPUT(), DAE.POTENTIAL()) then ();
1799+
end match;
18361800
end topLevelOutput;
18371801

18381802

Compiler/FrontEnd/CheckModel.mo

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -342,32 +342,12 @@ public function topLevelInput
342342
input DAE.ConnectorType inConnectorType;
343343
output Boolean b;
344344
algorithm
345-
b := matchcontinue (inComponentRef,inVarDirection,inConnectorType)
346-
local
347-
DAE.ComponentRef cr;
348-
String name;
349-
case ((cr as DAE.CREF_IDENT(ident = name)),DAE.INPUT(),_)
350-
equation
351-
{_} = Util.stringSplitAtChar(name, ".") "top level ident, no dots" ;
352-
then
353-
true;
354-
case (DAE.CREF_IDENT(ident = name),DAE.INPUT(),DAE.POTENTIAL()) /* Connector input variables at top level for crefs that are stringified */
355-
equation
356-
{_,_} = Util.stringSplitAtChar(name, ".");
357-
then
358-
true;
359-
case (DAE.CREF_IDENT(ident = name),DAE.INPUT(),DAE.FLOW())
360-
equation
361-
{_,_} = Util.stringSplitAtChar(name, ".");
362-
then
363-
true;
364-
/* For crefs that are not yet stringified, e.g. lower_known_var */
365-
case (DAE.CREF_QUAL(ident = name,componentRef = DAE.CREF_IDENT(ident = _)),DAE.INPUT(),DAE.FLOW()) then true;
366-
case ((cr as DAE.CREF_QUAL(ident = name,componentRef = DAE.CREF_IDENT(ident = _))),DAE.INPUT(),DAE.POTENTIAL()) then true;
367-
else
368-
then
369-
false;
370-
end matchcontinue;
345+
b := match (inComponentRef,inVarDirection,inConnectorType)
346+
case (DAE.CREF_IDENT(ident = _), DAE.INPUT(), _) then true;
347+
case (DAE.CREF_QUAL(componentRef = DAE.CREF_IDENT(ident = _)), DAE.INPUT(), DAE.FLOW()) then true;
348+
case (DAE.CREF_QUAL(componentRef = DAE.CREF_IDENT(ident = _)), DAE.INPUT(), DAE.POTENTIAL()) then true;
349+
else false;
350+
end match;
371351
end topLevelInput;
372352

373353
public function algorithmOutputs

0 commit comments

Comments
 (0)