Skip to content

Commit

Permalink
Handle ceval of asub using enum literals
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#2153
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Feb 1, 2018
1 parent c51b595 commit 047c5a8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Compiler/FrontEnd/ValuesUtil.mo
Expand Up @@ -2145,6 +2145,7 @@ algorithm
outValue:=
match (inLst, inValue,lastValue)
local
Boolean b;
Integer n;
Values.Value res,preRes;
list<Values.Value> vlst,vlst2;
Expand All @@ -2155,6 +2156,16 @@ algorithm
res = listGet(vlst, n);
res = nthnthArrayelt(vlst2,res,res);
then res;
case (((Values.ENUM_LITERAL(index=n))::vlst2),Values.ARRAY(valueLst = vlst),_)
equation
res = listGet(vlst, n);
res = nthnthArrayelt(vlst2,res,res);
then res;
case (((Values.BOOL(boolean=b))::vlst2),Values.ARRAY(valueLst = vlst),_)
equation
res = listGet(vlst, if b then 2 else 1);
res = nthnthArrayelt(vlst2,res,res);
then res;
end match;
end nthnthArrayelt;

Expand Down

0 comments on commit 047c5a8

Please sign in to comment.