Skip to content

Commit

Permalink
- fixed Expression.isCrefListWithEqualIdents
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@21986 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Marcus Walther committed Aug 26, 2014
1 parent 4111c31 commit 6844d5b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Compiler/FrontEnd/Expression.mo
Expand Up @@ -10906,6 +10906,7 @@ public function isCrefListWithEqualIdents
input list<DAE.Exp> iExpressions;
output Boolean oCrefWithEqualIdents;
protected
Boolean tmpCrefWithEqualIdents;
list<Boolean> boolHelperList;
list<DAE.ComponentRef> crefs;
DAE.Exp head;
Expand All @@ -10914,15 +10915,21 @@ algorithm
oCrefWithEqualIdents := matchcontinue(iExpressions)
case(head::_)
equation
//print("isCrefListWithEqualIdents: \n" +& stringDelimitList(List.map1(iExpressions, ExpressionDump.dumpExpStr, 1), ""));
boolHelperList = List.map(iExpressions, isCref);
true = List.reduce(boolHelperList,boolAnd);
//print("isCrefListWithEqualIdents: all crefs!\n");
crefs = List.map(iExpressions, expCref);
headCref = expCref(head);
boolHelperList = List.map1(crefs, ComponentReference.crefEqual, headCref);
then List.reduce(boolHelperList,boolAnd);
boolHelperList = List.map1(crefs, ComponentReference.crefEqualWithoutLastSubs, headCref);
tmpCrefWithEqualIdents = List.reduce(boolHelperList,boolAnd);
//print("isCrefListWithEqualIdents: returns " +& boolString(tmpCrefWithEqualIdents) +& "\n\n");
then tmpCrefWithEqualIdents;
case({})
then true;
else
equation
//print("isCrefListWithEqualIdents: returns false\n\n");
then false;
end matchcontinue;
end isCrefListWithEqualIdents;
Expand Down

0 comments on commit 6844d5b

Please sign in to comment.