@@ -8220,27 +8220,22 @@ algorithm
82208220 // e.g. Point p => Real p[3]; These must be handled separately since even if they do not
82218221 // appear to be an array, they can. Therefore we need to collect
82228222 // the full dimensionality and call instVar2
8223- case (cache,env,ih,store,ci_state,mod,pre,n,(cl as SCode.CLASS(name = id)),attr as SCode.ATTR(variability = vt),pf,_ ,idxs,inst_dims,impl,comment,_,graph,csets)
8223+ case (cache,env,ih,store,ci_state,mod,pre,n,(cl as SCode.CLASS(name = id)),attr as SCode.ATTR(variability = vt),pf,dims ,idxs,inst_dims,impl,comment,_,graph,csets)
82248224 equation
82258225 // Collect dimensions
82268226 p1 = Absyn.IDENT(n);
82278227 p1 = PrefixUtil.prefixPath(p1,pre);
82288228 str = Absyn.pathString(p1);
82298229 Error.updateCurrentComponent(str,info);
82308230 (cache, dims as (_ :: _),cl,type_mods) = getUsertypeDimensions(cache, env, ih, mod, pre, cl, inst_dims, impl);
8231-
8232- type_mods = Mod.addEachIfNeeded(type_mods, dims);
8233- mod = Mod.addEachIfNeeded(mod, inDimensionLst);
8234-
8235- dims = listAppend(inDimensionLst, dims);
82368231 mod = Mod.merge(mod, type_mods, env, pre);
82378232
82388233 attr = propagateClassPrefix(attr,pre);
82398234 (cache,compenv,ih,store,dae,csets,ty,graph) =
82408235 instVar2(cache,env,ih,store, ci_state, mod, pre, n, cl, attr,
82418236 pf, dims, idxs, inst_dims, impl, comment, info, graph, csets);
82428237 source = DAEUtil.createElementSource(info, Env.getEnvPath(env), PrefixUtil.prefixToCrefOpt(pre), NONE(), NONE());
8243- (cache,dae) = addArrayVarEquation(cache, env, ih, ci_state, dae, ty, mod, NFInstUtil.toConst(vt), pre, n, source);
8238+ (cache,dae) = addArrayVarEquation(cache,env,ih,ci_state, dae, ty, mod, NFInstUtil.toConst(vt), pre, n, source);
82448239 cache = addRecordConstructorFunction(cache,Types.arrayElementType(ty));
82458240 Error.updateCurrentComponent("",Absyn.dummyInfo);
82468241 then
@@ -9192,52 +9187,54 @@ algorithm
91929187 list<SCode.Element> els;
91939188 SCode.Path path;
91949189
9195- case (cache,_,_,_,_,cl as SCode.CLASS(name = "Real"),_,_) then (cache,{},cl,DAE.NOMOD());
9190+ case (cache,_,_,_,_,cl as SCode.CLASS(name = "Real"),_,_) then (cache,{},cl,DAE.NOMOD()); /* impl */
91969191 case (cache,_,_,_,_,cl as SCode.CLASS(name = "Integer"),_,_) then (cache,{},cl,DAE.NOMOD());
91979192 case (cache,_,_,_,_,cl as SCode.CLASS(name = "String"),_,_) then (cache,{},cl,DAE.NOMOD());
91989193 case (cache,_,_,_,_,cl as SCode.CLASS(name = "Boolean"),_,_) then (cache,{},cl,DAE.NOMOD());
91999194
92009195 case (cache,_,_,_,_,cl as SCode.CLASS(restriction = SCode.R_RECORD(),
92019196 classDef = SCode.PARTS(elementLst = _)),_,_) then (cache,{},cl,DAE.NOMOD());
92029197
9203- // ------------------------
9204- // MetaModelica extension
9205- case (cache, env, ih, _, pre, cl as SCode.CLASS(name = id, info=info,
9198+ /* ------------------------*/
9199+ /* MetaModelica extension */
9200+ case (cache,env,ih,_, pre,cl as SCode.CLASS(name = id, info=info,
92069201 classDef = SCode.DERIVED(Absyn.TCOMPLEX(Absyn.IDENT(_),_,arrayDim = ad),
92079202 modifications = mod)),
9208- dims, impl)
9203+ dims,impl)
92099204 equation
9210- true = Config.acceptMetaModelicaGrammar();
9205+ true= Config.acceptMetaModelicaGrammar();
92119206 owncref = Absyn.CREF_IDENT(id,{});
92129207 ad_1 = getOptionArraydim(ad);
9213- (cache,dim1) = elabArraydim(cache, env, owncref, Absyn.IDENT("Integer"), ad_1, NONE(), impl, NONE(), true, false, pre, info, dims);
9208+ // Absyn.IDENT("Integer") used as a dummie
9209+ (cache,dim1) = elabArraydim(cache,env, owncref, Absyn.IDENT("Integer"), ad_1,NONE(), impl,NONE(),true, false,pre,info,dims);
92149210 then
9215- (cache, dim1, cl, DAE.NOMOD());
9211+ (cache,dim1,cl,DAE.NOMOD());
92169212
92179213 // Partial function definitions with no output - stefan
9218- case (cache, env, ih, _, _,
9214+ case (cache,env,ih,_, _,
92199215 cl as SCode.CLASS(name = id,restriction = SCode.R_FUNCTION(SCode.FR_NORMAL_FUNCTION()),
92209216 partialPrefix = SCode.PARTIAL()),_,_)
92219217 then
92229218 (cache,{},cl,DAE.NOMOD());
92239219
9224- case (cache, env, ih, _, _,
9220+ case (cache,env,ih,_, _,
92259221 SCode.CLASS(name = id,info=info,restriction = SCode.R_FUNCTION(SCode.FR_NORMAL_FUNCTION()),
92269222 partialPrefix = SCode.NOT_PARTIAL()),_,_)
92279223 equation
92289224 Error.addSourceMessage(Error.META_FUNCTION_TYPE_NO_PARTIAL_PREFIX, {id}, info);
92299225 then fail();
92309226
9231- // MetaModelica Uniontype. Added 2009-05-11 sjoelund
9232- case (cache, env, ih, _, _,
9227+ // MetaModelica Uniontype. Added 2009-05-11 sjoelund
9228+ case (cache,env,ih,_, _,
92339229 cl as SCode.CLASS(name = id,restriction = SCode.R_UNIONTYPE()),_,_)
9234- then (cache, {}, cl, DAE.NOMOD());
9230+ then (cache,{},cl,DAE.NOMOD());
9231+ /*----------------------*/
92359232
9236- // Derived classes with restriction type, e.g. type Point = Real[3];
9237- case (cache, env, ih, mods, pre,
9233+ /* Derived classes with restriction type, e.g. type Point = Real[3]; */
9234+ case (cache,env,ih,mods,pre,
92389235 SCode.CLASS(name = id,restriction = SCode.R_TYPE(),info=info,
92399236 classDef = SCode.DERIVED(Absyn.TPATH(path = cn, arrayDim = ad),modifications = mod)),
9240- dims, impl)
9237+ dims,impl)
92419238 equation
92429239 (cache,cl,cenv) = Lookup.lookupClass(cache,env, cn, true);
92439240 owncref = Absyn.CREF_IDENT(id,{});
@@ -9250,37 +9247,29 @@ algorithm
92509247 mods_2 = Mod.merge(mods, mod_1, env, pre);
92519248 eq = Mod.modEquation(mods_2);
92529249 mods_3 = Mod.lookupCompModification(mods_2, id);
9253- (cache,dim1,cl,type_mods) = getUsertypeDimensions(cache, cenv, ih, mods_3, pre, cl, dims, impl);
9254- (cache,dim2) = elabArraydim(cache, env, owncref, cn, ad_1, eq, impl, NONE(), true, false, pre, info, dims);
9255-
9256- type_mods = Mod.addEachIfNeeded(type_mods, dim1);
9257- // do not add each to mod_1, it should have it already!
9258- // mod_1 = Mod.addEachIfNeeded(mod_1, dim2);
9259-
9260- res = listAppend(dim2, dim1);
9250+ (cache,dim1,cl,type_mods) = getUsertypeDimensions(cache,cenv,ih, mods_3, pre, cl, dims, impl);
92619251 type_mods = Mod.merge(mod_1, type_mods, env, pre);
9252+ (cache,dim2) = elabArraydim(cache,env, owncref, cn, ad_1, eq, impl,NONE(),true, false,pre,info,dims);
9253+ res = listAppend(dim2, dim1);
92629254 then
92639255 (cache,res,cl,type_mods);
92649256
9265- // extended classes type Y = Real[3]; class X extends Y;
9266- case (cache, env, ih, mods, pre,
9267- SCode.CLASS(name = id, restriction = _,
9257+ /* extended classes type Y = Real[3]; class X extends Y; */
9258+ case (cache,env,ih,mods,pre,
9259+ SCode.CLASS(name = id,restriction = _,
92689260 classDef = SCode.PARTS(elementLst=els,
9269- normalEquationLst = {},
9270- initialEquationLst = {},
9271- normalAlgorithmLst = {},
9272- initialAlgorithmLst = {},
9273- externalDecl = _)),
9274- dims, impl)
9261+ normalEquationLst= {},
9262+ initialEquationLst= {},
9263+ normalAlgorithmLst= {},
9264+ initialAlgorithmLst= {},
9265+ externalDecl= _)),
9266+ dims,impl)
92759267 equation
92769268 (_,_,{SCode.EXTENDS(path, _, mod,_, info)},{}) = splitElts(els); // ONLY ONE extends!
92779269 (cache,mod_1) = Mod.elabModForBasicType(cache, env, ih, pre, mod, impl, info);
92789270 mods_2 = Mod.merge(mods, mod_1, env, pre);
92799271 (cache,cl,cenv) = Lookup.lookupClass(cache,env, path, false);
92809272 (cache,res,cl,type_mods) = getUsertypeDimensions(cache,env,ih,mods_2,pre,cl,{},impl);
9281-
9282- type_mods = Mod.addEachIfNeeded(type_mods, res);
9283-
92849273 type_mods = Mod.merge(mods_2, type_mods, env, pre);
92859274 then
92869275 (cache,res,cl,type_mods);
0 commit comments