Skip to content

Commit

Permalink
Constant comparison of strings added in cevalRelation. The MetaModeli…
Browse files Browse the repository at this point in the history
…ca ==& operator is used, perhaps == should be used instead (if it is working?). Very easy to change. Non-constant comparison of strings will be added to the OMC shortly ...

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2821 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Kristian Stavåker committed Jun 7, 2007
1 parent 05b6072 commit 6a0707e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Compiler/Ceval.mo
Expand Up @@ -5633,7 +5633,7 @@ algorithm
Values.Value v,v1,v2;
Exp.Type t;
Boolean b,nb1,nb2,ba,bb,b1,b2;
Integer i1,i2;
Integer i1,i2;
case (v1,Exp.GREATER(ty = t),v2)
equation
v = cevalRelation(v2, Exp.LESS(t), v1);
Expand Down Expand Up @@ -5714,6 +5714,14 @@ algorithm
Values.BOOL(b);
case (Values.BOOL(boolean = false),Exp.LESS(ty = Exp.BOOL()),Values.BOOL(boolean = true)) then Values.BOOL(true);
case (Values.BOOL(boolean = _),Exp.LESS(ty = Exp.BOOL()),Values.BOOL(boolean = _)) then Values.BOOL(false);
case (Values.STRING(string = s1),Exp.EQUAL(ty = Exp.STRING()),Values.STRING(string = s2))
local
String s1,s2;
equation
b = (s1 ==& s2);
then
Values.BOOL(b);

case (_,_,_)
equation
Debug.fprint("failtrace", "- Ceval.cevalRelation failed\n");
Expand Down

0 comments on commit 6a0707e

Please sign in to comment.