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

Commit 5a7ce94

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Implemented evaluation of Integer().
Belonging to [master]: - #2401 - OpenModelica/OpenModelica-testsuite#935
1 parent 81ba868 commit 5a7ce94

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Compiler/NFFrontEnd/NFCeval.mo

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,6 +1176,7 @@ algorithm
11761176
case "floor" then evalBuiltinFloor(listHead(args));
11771177
case "identity" then evalBuiltinIdentity(listHead(args));
11781178
case "integer" then evalBuiltinInteger(listHead(args));
1179+
case "Integer" then evalBuiltinIntegerEnum(listHead(args));
11791180
case "log10" then evalBuiltinLog10(listHead(args), target);
11801181
case "log" then evalBuiltinLog(listHead(args), target);
11811182
//case "matrix" then evalBuiltinMatrix(args);
@@ -1595,6 +1596,16 @@ algorithm
15951596
end match;
15961597
end evalBuiltinInteger;
15971598

1599+
function evalBuiltinIntegerEnum
1600+
input Expression arg;
1601+
output Expression result;
1602+
algorithm
1603+
result := match arg
1604+
case Expression.ENUM_LITERAL() then Expression.INTEGER(arg.index);
1605+
else algorithm printWrongArgsError(getInstanceName(), {arg}, sourceInfo()); then fail();
1606+
end match;
1607+
end evalBuiltinIntegerEnum;
1608+
15981609
function evalBuiltinLog10
15991610
input Expression arg;
16001611
input EvalTarget target;

0 commit comments

Comments
 (0)