Skip to content

Commit

Permalink
Fix case for enum in FlagsUtil.flagDataString
Browse files Browse the repository at this point in the history
  • Loading branch information
perost committed Jan 20, 2021
1 parent 03da1b5 commit 305061b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion OMCompiler/Compiler/Util/FlagsUtil.mo
Expand Up @@ -1838,6 +1838,9 @@ function flagDataString
output String str;
algorithm
str := match flagData
local
Integer v;

case Flags.BOOL_FLAG() then boolString(flagData.data);
case Flags.INT_FLAG() then intString(flagData.data);
case Flags.INT_LIST_FLAG()
Expand All @@ -1846,7 +1849,17 @@ algorithm
case Flags.REAL_FLAG() then realString(flagData.data);
case Flags.STRING_FLAG() then flagData.data;
case Flags.STRING_LIST_FLAG() then stringDelimitList(flagData.data, ",");
case Flags.ENUM_FLAG() then Util.tuple21(listGet(flagData.validValues, flagData.data));
case Flags.ENUM_FLAG()
algorithm
for vt in flagData.validValues loop
(str, v) := vt;
if v == flagData.data then
return;
end if;
end for;
then
"";

else "";
end match;
end flagDataString;
Expand Down

0 comments on commit 305061b

Please sign in to comment.