Skip to content

Commit 3a964eb

Browse files
committed
- Added new field to DAE.ElementSource
- A list<Absyn.Info> so we can propagate line numbers for equations/algorithms further - Absyn.mo does not yet contain this information, so the list is empty for now - Changed code generation of functions without outputs - They now have void as return type, and we generate a lot less code when calling them - Added support for using builtin functions as function pointers - PartialFn14.mos tests this functionality - So far only print(<String>) is implemented in the runtime - SimCode.getCalledFunctionsInFunction was updated slightly to work better with the new DAE structure - DAEUtil.getNamedFunction now also looks in the FunctionTree structure git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5796 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent c4e97f2 commit 3a964eb

File tree

16 files changed

+1511
-1040
lines changed

16 files changed

+1511
-1040
lines changed

Compiler/Ceval.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ algorithm
224224
then
225225
fail();
226226

227-
case (cache,env,DAE.CREF(componentRef = c, ty = DAE.ET_FUNCTION_REFERENCE_FUNC()),impl,st,_,msg)
227+
case (cache,env,DAE.CREF(componentRef = c, ty = DAE.ET_FUNCTION_REFERENCE_FUNC(builtin = _)),impl,st,_,msg)
228228
local
229229
DAE.ComponentRef c;
230230
equation

Compiler/ConnectUtil.mo

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,7 @@ algorithm
703703
list<tuple<DAE.ComponentRef,DAE.ElementSource>> cs;
704704
DAE.ElementSource src,src1,src2;
705705
DAE.FunctionTree funcs;
706+
list<Absyn.Info> infoLst;
706707
list<Absyn.Within> partOfLst;
707708
list<Option<DAE.ComponentRef>> instanceOptLst;
708709
list<Option<tuple<DAE.ComponentRef, DAE.ComponentRef>>> connectEquationOptLst;
@@ -712,9 +713,9 @@ algorithm
712713
case ((x,src1) :: ((y,src2) :: cs))
713714
equation
714715
DAE.DAE(eq,funcs) = equEquations(((y,src2) :: cs));
715-
DAE.SOURCE(partOfLst, instanceOptLst, connectEquationOptLst, typeLst) = DAEUtil.mergeSources(src1,src2);
716+
DAE.SOURCE(infoLst, partOfLst, instanceOptLst, connectEquationOptLst, typeLst) = DAEUtil.mergeSources(src1,src2);
716717
// do not propagate connects from different sources! use the crefs directly!
717-
src = DAE.SOURCE(partOfLst, instanceOptLst, {SOME((x,y))}, typeLst);
718+
src = DAE.SOURCE(infoLst, partOfLst, instanceOptLst, {SOME((x,y))}, typeLst);
718719
then
719720
(DAE.DAE(DAE.EQUEQUATION(x,y,src) :: eq,funcs));
720721
case(_) equation print(" FAILURE IN CONNECT \n"); then fail();

Compiler/DAE.mo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,15 @@ end VarProtection;
104104

105105
uniontype ElementSource "gives information about the origin of the element"
106106
record SOURCE
107+
list<Absyn.Info> infoLst "the line and column numbers of the equations and algorithms this element came from; info does not yet exist in Absyn, but here is where it will end up";
107108
list<Absyn.Within> partOfLst "the model(s) this element came from";
108109
list<Option<ComponentRef>> instanceOptLst "the instance(s) this element is part of";
109110
list<Option<tuple<ComponentRef, ComponentRef>>> connectEquationOptLst "this element came from this connect(s)";
110111
list<Absyn.Path> typeLst "the classes where the type(s) of the element is defined";
111112
end SOURCE;
112113
end ElementSource;
113114

114-
public constant ElementSource emptyElementSource = SOURCE({},{},{},{});
115+
public constant ElementSource emptyElementSource = SOURCE({},{},{},{},{});
115116

116117
public uniontype Element
117118
record VAR
@@ -896,6 +897,7 @@ uniontype ExpType "- Basic types
896897
record ET_FUNCTION_REFERENCE_VAR "MetaModelica Function Reference that is a variable"
897898
end ET_FUNCTION_REFERENCE_VAR;
898899
record ET_FUNCTION_REFERENCE_FUNC "MetaModelica Function Reference that is a direct reference to a function"
900+
Boolean builtin;
899901
end ET_FUNCTION_REFERENCE_FUNC;
900902

901903
//MetaModelica Uniontype, MetaModelica extension, simbj

Compiler/DAEUtil.mo

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,48 +2118,52 @@ algorithm
21182118
end matchcontinue;
21192119
end toModelicaFormExp;
21202120

2121-
public function getNamedFunction "function: getNamedFunction
2121+
public function getNamedFunction "Return the FUNCTION with the given name. Fails if not found.
2122+
First tries to use the DAE.FunctionTree; if that fails, fall back to the old method of checking
2123+
top-level functions."
2124+
input Absyn.Path path;
2125+
input DAE.DAElist dae;
2126+
output DAE.Element outElement;
2127+
algorithm
2128+
outElement := matchcontinue (path,dae)
2129+
local
2130+
list<DAE.Element> elements;
2131+
DAE.FunctionTree functions;
2132+
case (path,DAE.DAE(functions = functions)) then avlTreeGet(functions, path);
2133+
case (path,DAE.DAE(elementLst = elements)) then getNamedFunctionFromElementList(path,elements);
2134+
case (_,_)
2135+
equation
2136+
Debug.fprintln("failtrace", "- DAEUtil.getNamedFunction failed");
2137+
then
2138+
fail();
2139+
end matchcontinue;
2140+
end getNamedFunction;
21222141

2123-
return the FUNCTION with the given name. Returns empty list if not found
2142+
public function getNamedFunctionFromElementList "
21242143
TODO: Only top level functions are checked. Add recursing into the DAE
21252144
and path name checking.
21262145
TODO: External functions?
21272146
"
21282147
input Absyn.Path inPath;
21292148
input list<DAE.Element> inElementLst;
2130-
output list<DAE.Element> outElementLst;
2149+
output DAE.Element outElement;
21312150
algorithm
2132-
outElementLst:=
2133-
matchcontinue (inPath,inElementLst)
2151+
outElement := matchcontinue (inPath,inElementLst)
21342152
local
21352153
Absyn.Path path,elpath;
21362154
DAE.Element el;
21372155
list<DAE.Element> rest,res;
2138-
case (path,{})
2139-
//equation print(" function " +& Absyn.pathString(path) +& " not found \n");
2140-
then {};
21412156
case (path,((el as DAE.FUNCTION(path = elpath)) :: rest))
21422157
equation
21432158
true = ModUtil.pathEqual(path, elpath);
2144-
then
2145-
{el};
2159+
then el;
21462160
case (path,((el as DAE.RECORD_CONSTRUCTOR(path = elpath)) :: rest))
21472161
equation
21482162
true = ModUtil.pathEqual(path, elpath);
2149-
then
2150-
{el};
2151-
case (path,(el :: rest))
2152-
equation
2153-
res = getNamedFunction(path, rest);
2154-
then
2155-
res;
2156-
case (_,_)
2157-
equation
2158-
Debug.fprintln("failtrace", "- DAEUtil.getNamedFunction failed");
2159-
then
2160-
fail();
2163+
then el;
2164+
case (path,(el :: rest)) then getNamedFunctionFromElementList(path, rest);
21612165
end matchcontinue;
2162-
end getNamedFunction;
2166+
end getNamedFunctionFromElementList;
21632167

21642168
public function getAllExps "function: getAllExps
21652169

@@ -3951,24 +3955,25 @@ algorithm
39513955
end matchcontinue;
39523956
end addComponentType;
39533957

3954-
public function addElementSourceType
3958+
protected function addElementSourceType
39553959
input DAE.ElementSource inSource;
39563960
input Absyn.Path classPath;
39573961
output DAE.ElementSource outSource;
39583962
algorithm
39593963
outSource := matchcontinue(inSource, classPath)
39603964
local
3965+
list<Absyn.Info> infoLst "the line and column numbers of the equations and algorithms this element came from";
39613966
list<Absyn.Path> typeLst "the absyn type of the element" ;
39623967
list<Absyn.Within> partOfLst "the models this element came from" ;
39633968
list<Option<DAE.ComponentRef>> instanceOptLst "the instance this element is part of" ;
39643969
list<Option<tuple<DAE.ComponentRef, DAE.ComponentRef>>> connectEquationOptLst "this element came from this connect" ;
39653970

3966-
case (DAE.SOURCE(partOfLst, instanceOptLst, connectEquationOptLst, typeLst), classPath)
3967-
then DAE.SOURCE(partOfLst, instanceOptLst, connectEquationOptLst, classPath::typeLst);
3971+
case (DAE.SOURCE(infoLst, partOfLst, instanceOptLst, connectEquationOptLst, typeLst), classPath)
3972+
then DAE.SOURCE(infoLst, partOfLst, instanceOptLst, connectEquationOptLst, classPath::typeLst);
39683973
end matchcontinue;
39693974
end addElementSourceType;
39703975

3971-
public function addElementSourceTypeOpt
3976+
protected function addElementSourceTypeOpt
39723977
input DAE.ElementSource inSource;
39733978
input Option<Absyn.Path> classPathOpt;
39743979
output DAE.ElementSource outSource;
@@ -3992,13 +3997,14 @@ public function addElementSourcePartOf
39923997
algorithm
39933998
outSource := matchcontinue(inSource, withinPath)
39943999
local
4000+
list<Absyn.Info> infoLst "the line and column numbers of the equations and algorithms this element came from";
39954001
list<Absyn.Path> typeLst "the absyn type of the element" ;
39964002
list<Absyn.Within> partOfLst "the models this element came from" ;
39974003
list<Option<DAE.ComponentRef>> instanceOptLst "the instance this element is part of" ;
39984004
list<Option<tuple<DAE.ComponentRef, DAE.ComponentRef>>> connectEquationOptLst "this element came from this connect" ;
39994005

4000-
case (DAE.SOURCE(partOfLst, instanceOptLst, connectEquationOptLst, typeLst), withinPath)
4001-
then DAE.SOURCE(withinPath::partOfLst, instanceOptLst, connectEquationOptLst, typeLst);
4006+
case (DAE.SOURCE(infoLst,partOfLst, instanceOptLst, connectEquationOptLst, typeLst), withinPath)
4007+
then DAE.SOURCE(infoLst,withinPath::partOfLst, instanceOptLst, connectEquationOptLst, typeLst);
40024008
end matchcontinue;
40034009
end addElementSourcePartOf;
40044010

@@ -4032,14 +4038,15 @@ algorithm
40324038
local
40334039
Absyn.Path classPath;
40344040
DAE.ElementSource src;
4041+
list<Absyn.Info> infoLst "the line and column numbers of the equations and algorithms this element came from";
40354042
list<Absyn.Within> partOfLst "the models this element came from" ;
40364043
list<Option<DAE.ComponentRef>> instanceOptLst "the instance this element is part of" ;
40374044
list<Option<tuple<DAE.ComponentRef, DAE.ComponentRef>>> connectEquationOptLst "this element came from this connect" ;
40384045
list<Absyn.Path> typeLst "the classes where the type of the element is defined" ;
40394046

40404047
// a NONE means top level (equivalent to NO_PRE, SOME(cref) means subcomponent
4041-
case (DAE.SOURCE(partOfLst,instanceOptLst,connectEquationOptLst,typeLst), instanceOpt)
4042-
then DAE.SOURCE(partOfLst,instanceOpt::instanceOptLst,connectEquationOptLst,typeLst);
4048+
case (DAE.SOURCE(infoLst,partOfLst,instanceOptLst,connectEquationOptLst,typeLst), instanceOpt)
4049+
then DAE.SOURCE(infoLst,partOfLst,instanceOpt::instanceOptLst,connectEquationOptLst,typeLst);
40434050
end matchcontinue;
40444051
end addElementSourceInstanceOpt;
40454052

@@ -4052,15 +4059,16 @@ algorithm
40524059
local
40534060
Absyn.Path classPath;
40544061
DAE.ElementSource src;
4062+
list<Absyn.Info> infoLst "the line and column numbers of the equations and algorithms this element came from";
40554063
list<Absyn.Within> partOfLst "the models this element came from" ;
40564064
list<Option<DAE.ComponentRef>> instanceOptLst "the instance this element is part of" ;
40574065
list<Option<tuple<DAE.ComponentRef, DAE.ComponentRef>>> connectEquationOptLst "this element came from this connect" ;
40584066
list<Absyn.Path> typeLst "the classes where the type of the element is defined" ;
40594067

40604068
// a top level
40614069
case (inSource, NONE()) then inSource;
4062-
case (inSource as DAE.SOURCE(partOfLst,instanceOptLst,connectEquationOptLst,typeLst), connectEquationOpt)
4063-
then DAE.SOURCE(partOfLst,instanceOptLst,connectEquationOpt::connectEquationOptLst,typeLst);
4070+
case (inSource as DAE.SOURCE(infoLst,partOfLst,instanceOptLst,connectEquationOptLst,typeLst), connectEquationOpt)
4071+
then DAE.SOURCE(infoLst,partOfLst,instanceOptLst,connectEquationOpt::connectEquationOptLst,typeLst);
40644072
end matchcontinue;
40654073
end addElementSourceConnectOpt;
40664074

@@ -4110,6 +4118,7 @@ algorithm
41104118
// function
41114119
case(DAE.FUNCTION(path=name)::rest)
41124120
equation
4121+
Debug.traceln("adding func " +& Absyn.pathString(name));
41134122
functionPaths = getFunctionNames(rest);
41144123
then name::functionPaths;
41154124
// record constructors
@@ -4191,18 +4200,20 @@ public function mergeSources
41914200
algorithm
41924201
mergedSrc := matchcontinue(src1,src2)
41934202
local
4203+
list<Absyn.Info> infoLst1,infoLst2,infoLst3;
41944204
list<Absyn.Within> partOfLst1,partOfLst2,p;
41954205
list<Option<DAE.ComponentRef>> instanceOptLst1,instanceOptLst2,i;
41964206
list<Option<tuple<DAE.ComponentRef, DAE.ComponentRef>>> connectEquationOptLst1,connectEquationOptLst2,c;
41974207
list<Absyn.Path> typeLst1,typeLst2,t;
4198-
case (DAE.SOURCE(partOfLst1, instanceOptLst1, connectEquationOptLst1, typeLst1),
4199-
DAE.SOURCE(partOfLst2, instanceOptLst2, connectEquationOptLst2, typeLst2))
4208+
case (DAE.SOURCE(infoLst1, partOfLst1, instanceOptLst1, connectEquationOptLst1, typeLst1),
4209+
DAE.SOURCE(infoLst2, partOfLst2, instanceOptLst2, connectEquationOptLst2, typeLst2))
42004210
equation
4211+
infoLst3 = listAppend(infoLst1, infoLst2);
42014212
p = listAppend(partOfLst1, partOfLst2);
42024213
i = listAppend(instanceOptLst1, instanceOptLst2);
42034214
c = listAppend(connectEquationOptLst1, connectEquationOptLst1);
42044215
t = listAppend(typeLst1, typeLst2);
4205-
then DAE.SOURCE(p,i,c,t);
4216+
then DAE.SOURCE(infoLst3,p,i,c,t);
42064217
end matchcontinue;
42074218
end mergeSources;
42084219

Compiler/Exp.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9168,7 +9168,7 @@ algorithm
91689168
case ((e as DAE.SCONST(string = _))) then e;
91699169
case ((e as DAE.BCONST(bool = _))) then e;
91709170
case ((e as DAE.CREF(ty = DAE.ET_FUNCTION_REFERENCE_VAR))) then e;
9171-
case ((e as DAE.CREF(ty = DAE.ET_FUNCTION_REFERENCE_FUNC))) then e;
9171+
case ((e as DAE.CREF(ty = DAE.ET_FUNCTION_REFERENCE_FUNC(builtin = _)))) then e;
91729172
case (DAE.CREF(componentRef = cr,ty = t))
91739173
equation
91749174
cr_1 = stringifyComponentRef(cr);

Compiler/Inline.mo

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,14 +1086,14 @@ algorithm
10861086
local
10871087
list<DAE.Element> flst,fn;
10881088
DAE.FunctionTree ftree;
1089-
case(p,(SOME(flst),_,_))
1090-
equation
1091-
DAE.FUNCTION( functions = DAE.FUNCTION_DEF(body = fn)::_) :: _ = DAEUtil.getNamedFunction(p,flst);
1092-
then fn;
10931089
case(p,(_,SOME(ftree),_))
1094-
equation
1095-
DAE.FUNCTION( functions = DAE.FUNCTION_DEF(body = fn)::_) = DAEUtil.avlTreeGet(ftree,p);
1096-
then fn;
1090+
equation
1091+
DAE.FUNCTION( functions = DAE.FUNCTION_DEF(body = fn)::_) = DAEUtil.avlTreeGet(ftree,p);
1092+
then fn;
1093+
case(p,(SOME(flst),_,_))
1094+
equation
1095+
DAE.FUNCTION( functions = DAE.FUNCTION_DEF(body = fn)::_) = DAEUtil.getNamedFunctionFromElementList(p,flst);
1096+
then fn;
10971097
case(_,_)
10981098
equation
10991099
Debug.fprintln("failtrace","Inline.getFunctionBody failed");

Compiler/Inst.mo

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,7 +1931,7 @@ algorithm
19311931
eqConstraint = equalityConstraint(cache, env_2, els);
19321932
dae1_1 = DAEUtil.addComponentType(dae1, fq_class);
19331933
names = SCode.componentNames(c);
1934-
bc = arrayBasictypeBaseclass(inst_dims, (DAE.T_ENUMERATION(NONE(),Absyn.IDENT(""),names,tys1),NONE));
1934+
bc = arrayBasictypeBaseclass(inst_dims, (DAE.T_ENUMERATION(NONE(),Absyn.IDENT(""),names,tys1),NONE()));
19351935
ty = mktype(fq_class, ci_state_1, tys1, bc, eqConstraint, c);
19361936
// update Enumerationtypes in environment
19371937
(cache,env_3) = updateEnumerationEnvironment(cache,env_2,ty,c,ci_state_1);
@@ -1995,16 +1995,16 @@ end isBuiltInClass;
19951995
protected constant DAE.Type stateSelectType = (DAE.T_ENUMERATION(NONE(),Absyn.IDENT(""),{"never","avoid","default","prefer","always"},
19961996
{
19971997
DAE.TYPES_VAR("never",DAE.ATTR(false,false,SCode.RO(),SCode.PARAM(),Absyn.BIDIR(),Absyn.UNSPECIFIED()),false,
1998-
(DAE.T_ENUMERATION(SOME(1),Absyn.IDENT(""),{"never","avoid","default","prefer","always"},{}),NONE),DAE.UNBOUND(),NONE()),
1998+
(DAE.T_ENUMERATION(SOME(1),Absyn.IDENT(""),{"never","avoid","default","prefer","always"},{}),NONE()),DAE.UNBOUND(),NONE()),
19991999
DAE.TYPES_VAR("avoid",DAE.ATTR(false,false,SCode.RO(),SCode.PARAM(),Absyn.BIDIR(),Absyn.UNSPECIFIED()),false,
2000-
(DAE.T_ENUMERATION(SOME(2),Absyn.IDENT(""),{"never","avoid","default","prefer","always"},{}),NONE),DAE.UNBOUND(),NONE()),
2000+
(DAE.T_ENUMERATION(SOME(2),Absyn.IDENT(""),{"never","avoid","default","prefer","always"},{}),NONE()),DAE.UNBOUND(),NONE()),
20012001
DAE.TYPES_VAR("default",DAE.ATTR(false,false,SCode.RO(),SCode.PARAM(),Absyn.BIDIR(),Absyn.UNSPECIFIED()),false,
2002-
(DAE.T_ENUMERATION(SOME(3),Absyn.IDENT(""),{"never","avoid","default","prefer","always"},{}),NONE),DAE.UNBOUND(),NONE()),
2002+
(DAE.T_ENUMERATION(SOME(3),Absyn.IDENT(""),{"never","avoid","default","prefer","always"},{}),NONE()),DAE.UNBOUND(),NONE()),
20032003
DAE.TYPES_VAR("prefer",DAE.ATTR(false,false,SCode.RO(),SCode.PARAM(),Absyn.BIDIR(),Absyn.UNSPECIFIED()),false,
2004-
(DAE.T_ENUMERATION(SOME(4),Absyn.IDENT(""),{"never","avoid","default","prefer","always"},{}),NONE),DAE.UNBOUND(),NONE()),
2004+
(DAE.T_ENUMERATION(SOME(4),Absyn.IDENT(""),{"never","avoid","default","prefer","always"},{}),NONE()),DAE.UNBOUND(),NONE()),
20052005
DAE.TYPES_VAR("always",DAE.ATTR(false,false,SCode.RO(),SCode.PARAM(),Absyn.BIDIR(),Absyn.UNSPECIFIED()),false,
2006-
(DAE.T_ENUMERATION(SOME(5),Absyn.IDENT(""),{"never","avoid","default","prefer","always"},{}),NONE),DAE.UNBOUND(),NONE())
2007-
}),NONE);
2006+
(DAE.T_ENUMERATION(SOME(5),Absyn.IDENT(""),{"never","avoid","default","prefer","always"},{}),NONE()),DAE.UNBOUND(),NONE())
2007+
}),NONE());
20082008

20092009
protected function instRealClass
20102010
"function instRealClass
@@ -2233,17 +2233,17 @@ algorithm
22332233
case(cache,env,DAE.MOD(f,e,DAE.NAMEMOD("min",DAE.MOD(_,_,_,SOME(DAE.TYPED(exp,optVal,p,_))))::submods,eqmod),pre)
22342234
equation
22352235
varLst = instEnumerationClass(cache,env,DAE.MOD(f,e,submods,eqmod),pre);
2236-
v = instBuiltinAttribute(cache,env,"min",optVal,exp,(DAE.T_ENUMERATION(NONE(),Absyn.IDENT(""),{},{}),NONE),p);
2236+
v = instBuiltinAttribute(cache,env,"min",optVal,exp,(DAE.T_ENUMERATION(NONE(),Absyn.IDENT(""),{},{}),NONE()),p);
22372237
then v::varLst;
22382238
case(cache,env,DAE.MOD(f,e,DAE.NAMEMOD("max",DAE.MOD(_,_,_,SOME(DAE.TYPED(exp,optVal,p,_))))::submods,eqmod),pre)
22392239
equation
22402240
varLst = instEnumerationClass(cache,env,DAE.MOD(f,e,submods,eqmod),pre);
2241-
v = instBuiltinAttribute(cache,env,"max",optVal,exp,(DAE.T_ENUMERATION(NONE(),Absyn.IDENT(""),{},{}),NONE),p);
2241+
v = instBuiltinAttribute(cache,env,"max",optVal,exp,(DAE.T_ENUMERATION(NONE(),Absyn.IDENT(""),{},{}),NONE()),p);
22422242
then v::varLst;
22432243
case(cache,env,DAE.MOD(f,e,DAE.NAMEMOD("start",DAE.MOD(_,_,_,SOME(DAE.TYPED(exp,optVal,p,_))))::submods,eqmod),pre)
22442244
equation
22452245
varLst = instEnumerationClass(cache,env,DAE.MOD(f,e,submods,eqmod),pre);
2246-
v = instBuiltinAttribute(cache,env,"start",optVal,exp,(DAE.T_ENUMERATION(NONE(),Absyn.IDENT(""),{},{}),NONE),p);
2246+
v = instBuiltinAttribute(cache,env,"start",optVal,exp,(DAE.T_ENUMERATION(NONE(),Absyn.IDENT(""),{},{}),NONE()),p);
22472247
then v::varLst;
22482248
case(cache,env,DAE.MOD(f,e,DAE.NAMEMOD("fixed",DAE.MOD(_,_,_,SOME(DAE.TYPED(exp,optVal,p,_))))::submods,eqmod),pre)
22492249
equation
@@ -7584,10 +7584,10 @@ algorithm
75847584
eq = Mod.modEquation(mod_3);
75857585

75867586
owncref = Absyn.CREF_IDENT(name,{});
7587-
(cache,dims,dae3) = elabArraydim(cache,env,owncref,path,ad,eq,impl,NONE,true, false)
7587+
(cache,dims,dae3) = elabArraydim(cache,env,owncref,path,ad,eq,impl,NONE(),true, false)
75887588
"The variable declaration and the (optional) equation modification are inspected for array dimensions." ;
75897589
/* Instantiate the component */
7590-
(cache,compenv,ih,_,DAE.DAE(_,funcs),csets_1,ty,_) = instVar(cache, cenv, ih, UnitAbsyn.noStore, ci_state, mod_3, pre, csets, name, cl, attr, prot, dims, {}, {}, impl, NONE, io, finalPrefix, info, ConnectionGraph.EMPTY);
7590+
(cache,compenv,ih,_,DAE.DAE(_,funcs),csets_1,ty,_) = instVar(cache, cenv, ih, UnitAbsyn.noStore, ci_state, mod_3, pre, csets, name, cl, attr, prot, dims, {}, {}, impl, NONE(), io, finalPrefix, info, ConnectionGraph.EMPTY);
75917591

75927592
// print("updateComponentInEnv -> 1 component: " +& n +& " ty: " +& Types.printTypeStr(ty) +& "\n");
75937593

@@ -7698,7 +7698,7 @@ algorithm
76987698
outIntegerOption := matchcontinue (inDimExp)
76997699
local Integer i;
77007700
case DIMINT(integer = i) then SOME(i);
7701-
case DIMEXP(subscript = _) then NONE;
7701+
case DIMEXP(subscript = _) then NONE();
77027702
end matchcontinue;
77037703
end instDimType;
77047704

@@ -15205,8 +15205,8 @@ algorithm
1520515205
// case (SOME(DAE.CREF(DAE.CREF_QUAL("StateSelect",_,{},DAE.CREF_IDENT("default",_,{})),Exp.ENUM()))) then SOME(DAE.DEFAULT());
1520615206
// case (SOME(DAE.CREF(DAE.CREF_QUAL("StateSelect",_,{},DAE.CREF_IDENT("prefer",_,{})),Exp.ENUM()))) then SOME(DAE.PREFER());
1520715207
// case (SOME(DAE.CREF(DAE.CREF_QUAL("StateSelect",_,{},DAE.CREF_IDENT("always",_,{})),Exp.ENUM()))) then SOME(DAE.ALWAYS());
15208-
case (NONE) then NONE;
15209-
case (_) then NONE;
15208+
case (NONE()) then NONE();
15209+
case (_) then NONE();
1521015210
end matchcontinue;
1521115211
end getStateSelectFromExpOption;
1521215212

0 commit comments

Comments
 (0)