Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 047c5a8

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Handle ceval of asub using enum literals
Belonging to [master]: - #2153
1 parent c51b595 commit 047c5a8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Compiler/FrontEnd/ValuesUtil.mo

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,6 +2145,7 @@ algorithm
21452145
outValue:=
21462146
match (inLst, inValue,lastValue)
21472147
local
2148+
Boolean b;
21482149
Integer n;
21492150
Values.Value res,preRes;
21502151
list<Values.Value> vlst,vlst2;
@@ -2155,6 +2156,16 @@ algorithm
21552156
res = listGet(vlst, n);
21562157
res = nthnthArrayelt(vlst2,res,res);
21572158
then res;
2159+
case (((Values.ENUM_LITERAL(index=n))::vlst2),Values.ARRAY(valueLst = vlst),_)
2160+
equation
2161+
res = listGet(vlst, n);
2162+
res = nthnthArrayelt(vlst2,res,res);
2163+
then res;
2164+
case (((Values.BOOL(boolean=b))::vlst2),Values.ARRAY(valueLst = vlst),_)
2165+
equation
2166+
res = listGet(vlst, if b then 2 else 1);
2167+
res = nthnthArrayelt(vlst2,res,res);
2168+
then res;
21582169
end match;
21592170
end nthnthArrayelt;
21602171

0 commit comments

Comments
 (0)