Skip to content

Commit

Permalink
- added EnumToInteger(Enumeration) -> Integer as a workaround until D…
Browse files Browse the repository at this point in the history
…ymola supports Integer(Enumeration) -> Integer.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13858 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Nov 10, 2012
1 parent 79e5621 commit a936826
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions Compiler/FrontEnd/Builtin.mo
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ algorithm
env = Env.extendFrameT(env, "cardinality", anyNonExpandableConnector2int);
env = Env.extendFrameT(env, "cardinality", anyExpandableConnector2int);
env = Env.extendFrameT(env, "Integer", enumeration2int);
env = Env.extendFrameT(env, "EnumToInteger", enumeration2int);
env = Env.extendFrameT(env, "noEvent", real2real);
env = Env.extendFrameT(env, "constrain", realrealreal2real);
env = Env.extendFrameT(env, "constrain", array1dimrealarray1dimrealarray1dimreal2array1dimreal);
Expand Down
1 change: 1 addition & 0 deletions Compiler/FrontEnd/Ceval.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,7 @@ algorithm
case "promote" then cevalBuiltinPromote;
case "String" then cevalBuiltinString;
case "Integer" then cevalBuiltinIntegerEnumeration;
case "EnumToInteger" then cevalBuiltinIntegerEnumeration;
case "rooted" then cevalBuiltinRooted; //
case "cross" then cevalBuiltinCross;
case "fill" then cevalBuiltinFill;
Expand Down
10 changes: 8 additions & 2 deletions Compiler/FrontEnd/Static.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4705,7 +4705,7 @@ protected function elabBuiltinIntegerEnum
output DAE.Exp outExp;
output DAE.Properties outProperties;
algorithm
(outCache,outExp,outProperties) := match (inCache,inEnv,inAbsynExpLst,inNamedArg,inBoolean,inPrefix,info)
(outCache,outExp,outProperties) := matchcontinue (inCache,inEnv,inAbsynExpLst,inNamedArg,inBoolean,inPrefix,info)
local
DAE.Exp s1_1;
list<Env.Frame> env;
Expand All @@ -4719,7 +4719,12 @@ algorithm
(cache,s1_1,prop) = verifyBuiltInHandlerType(cache,env,{s1},impl,Types.isEnumeration,"Integer",pre,info);
then
(cache,s1_1,prop);
end match;
case (cache,env,{s1},_,impl,pre,_)
equation
(cache,s1_1,prop) = verifyBuiltInHandlerType(cache,env,{s1},impl,Types.isEnumeration,"EnumToInteger",pre,info);
then
(cache,s1_1,prop);
end matchcontinue;
end elabBuiltinIntegerEnum;

protected function elabBuiltinDiagonal "function: elabBuiltinDiagonal
Expand Down Expand Up @@ -6166,6 +6171,7 @@ algorithm
case "String" then elabBuiltinString;
case "rooted" then elabBuiltinRooted;
case "Integer" then elabBuiltinIntegerEnum;
case "EnumToInteger" then elabBuiltinIntegerEnum;
case "inStream" then elabBuiltinInStream;
case "actualStream" then elabBuiltinActualStream;
case "getInstanceName" then elabBuiltinGetInstanceName;
Expand Down

0 comments on commit a936826

Please sign in to comment.