Skip to content

Commit

Permalink
Handle expandExpression for unary
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Mar 1, 2016
1 parent a1a01c3 commit 26ec49e
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions Compiler/FrontEnd/Expression.mo
Expand Up @@ -2747,12 +2747,12 @@ algorithm
e = expMul(e, e1);
fx1 = List.map1(fx1,expMul,e1);
if not isZero(e) then
if expHasCrefNoPreOrStart(e1,cr) then
fx1 = e :: fx1;
f1 = {};
else
f1 = {e};
end if;
if expHasCrefNoPreOrStart(e1,cr) then
fx1 = e :: fx1;
f1 = {};
else
f1 = {e};
end if;
end if;
//f1 = List.flatten(List.map1(fx1,allTermsForCref, cr));
then
Expand All @@ -2769,12 +2769,12 @@ algorithm
e = expMul(e, e2);
fx1 = List.map1(fx1,expMul,e2);
if not isZero(e) then
if expHasCrefNoPreOrStart(e1,cr) then
fx1 = e :: fx1;
f1 = {};
else
f1 = {e};
end if;
if expHasCrefNoPreOrStart(e1,cr) then
fx1 = e :: fx1;
f1 = {};
else
f1 = {e};
end if;
end if;
//fx1 = List.flatten(List.map1(fx1,allTermsForCref, cr));
then
Expand All @@ -2791,12 +2791,12 @@ algorithm
e = makeDiv(e, e2);
fx1 = List.map1(fx1,makeDiv,e2);
if not isZero(e) then
if expHasCrefNoPreOrStart(e1,cr) then
fx1 = e :: fx1;
f1 = {};
else
f1 = {e};
end if;
if expHasCrefNoPreOrStart(e1,cr) then
fx1 = e :: fx1;
f1 = {};
else
f1 = {e};
end if;
end if;
//fx1 = List.flatten(List.map1(fx1,allTermsForCref, cr));
then
Expand Down Expand Up @@ -12127,6 +12127,11 @@ algorithm
outExps := List.map(crlst, crefToExp);
then outExps;

case (DAE.UNARY(operator=DAE.UMINUS()))
algorithm
expl := list(DAE.UNARY(inExp.operator, exp) for exp in expandExpression(inExp.exp));
then expl;

case DAE.ARRAY(_,_,expl)
algorithm
expl := List.mapFlat(expl,expandExpression);
Expand Down

0 comments on commit 26ec49e

Please sign in to comment.