Skip to content

Commit

Permalink
- ExpressionSimplify: Added rule for "s1"+"s2"=>"s"
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7366 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Dec 12, 2010
1 parent c17fa42 commit 37bbd75
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Compiler/ExpressionSimplify.mo
Expand Up @@ -2593,7 +2593,8 @@ algorithm
Operator op;
Boolean b,b1,b2;
DAE.Exp exp1,exp2,val;
Real re1,re2,re3;
Real re1,re2,re3;
String str,s1,s2;

case (DAE.ADD(ty = _),DAE.ICONST(integer = ie1),DAE.ICONST(integer = ie2))
equation
Expand Down Expand Up @@ -2621,6 +2622,12 @@ algorithm
then
DAE.RCONST(re3);

case (DAE.ADD(ty = _),DAE.SCONST(string = s1),DAE.SCONST(string = s2))
equation
str = s1 +& s2;
then
DAE.SCONST(str);

case (DAE.SUB(ty = _),DAE.ICONST(integer = ie1),DAE.ICONST(integer = ie2))
equation
val = safeIntOp(ie1,ie2,SUBOP());
Expand Down

0 comments on commit 37bbd75

Please sign in to comment.