Ticket #1931: Inst.diff
| File Inst.diff, 2.2 KB (added by , 13 years ago) |
|---|
-
Compiler/FrontEnd/Inst.mo
8168 8168 DAE.Dimensions dims; 8169 8169 DAE.ComponentRef cr; 8170 8170 DAE.Type ty; 8171 case (_,_,_,_,DAE.DAE(dae),_,_, DAE.C_VAR(),_,_,_)8171 case (_,_,_,_,DAE.DAE(dae),_,_,_,_,_,_) 8172 8172 equation 8173 false = Types.isConstant(const); 8173 8174 false = ClassInf.isFunctionOrRecord(inState); 8174 8175 ty = Types.simplifyType(inType); 8175 8176 false = Types.isExternalObject(Types.arrayElementType(ty)); … … 8178 8179 SOME(exp) = makeVariableBinding(ty, mod, const, pre, n, source); 8179 8180 cr = ComponentReference.makeCrefIdent(n,ty,{}); 8180 8181 (cache,cr) = PrefixUtil.prefixCref(inCache,inEnv,inIH,pre,cr); 8181 eq = DAE.ARRAY_EQUATION(dims, DAE.CREF(cr,ty), exp, source);8182 eq = Util.if_(Types.isParameter(const),DAE.INITIAL_ARRAY_EQUATION(dims, DAE.CREF(cr,ty), exp, source),DAE.ARRAY_EQUATION(dims, DAE.CREF(cr,ty), exp, source)); 8182 8183 // print("Creating array equation for " +& PrefixUtil.printPrefixStr(pre) +& "." +& n +& " of const " +& DAEUtil.constStr(const) +& " in classinf " +& ClassInf.printStateStr(inState) +& "\n"); 8183 8184 then (cache,DAE.DAE(eq::dae)); 8184 8185 else (inCache,inDae); … … 8580 8581 PrefixUtil.prefixToCrefOpt(inPrefix), NONE(), NONE()); 8581 8582 8582 8583 // Instantiate the components binding. 8583 mod = Util.if_(listLength(inSubscripts) > 0 and not SCode.is ParameterOrConst(vt) and not ClassInf.isFunctionOrRecord(inState) and not Types.isComplexType(Types.arrayElementType(ty)) and not Types.isExternalObject(Types.arrayElementType(ty)),DAE.NOMOD(),inMod);8584 mod = Util.if_(listLength(inSubscripts) > 0 and not SCode.isConstant(vt) and not ClassInf.isFunctionOrRecord(inState) and not Types.isComplexType(Types.arrayElementType(ty)) and not Types.isExternalObject(Types.arrayElementType(ty)),DAE.NOMOD(),inMod); 8584 8585 opt_binding = makeVariableBinding(ty, mod, InstUtil.toConst(vt), inPrefix, inName, source); 8585 8586 start = instStartBindingExp(inMod /* Yup, let's keep the start-binding. It seems sane. */, ty, vt); 8586 8587
