Skip to content

Commit

Permalink
- Added output String name to lookupVar functions, so it's possible t…
Browse files Browse the repository at this point in the history
…o create the correct FQ path from the output

- Testcase Import6 tests this (import a=X.b would previously get FQ path X.a)


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5906 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Aug 10, 2010
1 parent bb5feeb commit cdb205f
Show file tree
Hide file tree
Showing 11 changed files with 130 additions and 123 deletions.
36 changes: 18 additions & 18 deletions Compiler/Ceval.mo
Expand Up @@ -1763,7 +1763,7 @@ algorithm
(cache,Values.INTEGER(v),st);
case (cache,env,DAE.CREF(componentRef = cr,ty = tp),dim,impl,st,msg)
equation
(cache,attr,tp,bind,_,_,_,_) = Lookup.lookupVar(cache,env, cr) "If dimensions known, always ceval" ;
(cache,attr,tp,bind,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr) "If dimensions known, always ceval" ;
true = Types.dimensionsKnown(tp);
sizelst = Types.getDimensionSizes(tp);
(cache,Values.INTEGER(dim),st_1) = ceval(cache, env, dim, impl, st, NONE, msg);
Expand Down Expand Up @@ -1791,14 +1791,14 @@ algorithm
case (cache,env,DAE.CREF(componentRef = cr,ty = tp),dim,(impl as true),st,msg)
local DAE.Exp dim;
equation
(cache,attr,tp,bind,_,_,_,_) = Lookup.lookupVar(cache,env, cr) "If dimensions not known and impl=true, just silently fail" ;
(cache,attr,tp,bind,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr) "If dimensions not known and impl=true, just silently fail" ;
false = Types.dimensionsKnown(tp);
then
fail();
case (cache,env,DAE.CREF(componentRef = cr,ty = tp),dim,(impl as false),st,MSG())
local DAE.Exp dim;
equation
(cache,attr,tp,bind,_,_,_,_) = Lookup.lookupVar(cache,env, cr) "If dimensions not known and impl=false, error message" ;
(cache,attr,tp,bind,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr) "If dimensions not known and impl=false, error message" ;

false = Types.dimensionsKnown(tp);
cr_str = Exp.printComponentRefStr(cr);
Expand All @@ -1810,28 +1810,28 @@ algorithm
case (cache,env,DAE.CREF(componentRef = cr,ty = tp),dim,(impl as false),st,NO_MSG())
local DAE.Exp dim;
equation
(cache,attr,tp,bind,_,_,_,_) = Lookup.lookupVar(cache,env, cr);
(cache,attr,tp,bind,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr);
false = Types.dimensionsKnown(tp);
then
fail();
case (cache,env,(exp as DAE.CREF(componentRef = cr,ty = crtp)),dim,(impl as false),st,MSG())
local DAE.Exp dim;
equation
(cache,attr,tp,DAE.UNBOUND(),_,_,_,_) = Lookup.lookupVar(cache,env, cr) "For crefs without value binding" ;
(cache,attr,tp,DAE.UNBOUND(),_,_,_,_,_) = Lookup.lookupVar(cache,env, cr) "For crefs without value binding" ;
expstr = Exp.printExpStr(exp);
Error.addMessage(Error.UNBOUND_VALUE, {expstr});
then
fail();
case (cache,env,(exp as DAE.CREF(componentRef = cr,ty = crtp)),dim,(impl as false),st,NO_MSG())
local DAE.Exp dim;
equation
(cache,attr,tp,DAE.UNBOUND(),_,_,_,_) = Lookup.lookupVar(cache,env, cr);
(cache,attr,tp,DAE.UNBOUND(),_,_,_,_,_) = Lookup.lookupVar(cache,env, cr);
then
fail();
case (cache,env,(exp as DAE.CREF(componentRef = cr,ty = crtp)),dim,(impl as true),st,msg)
local DAE.Exp dim;
equation
(cache,attr,tp,DAE.UNBOUND(),_,_,_,_) = Lookup.lookupVar(cache,env, cr) "For crefs without value binding. If impl=true just silently fail" ;
(cache,attr,tp,DAE.UNBOUND(),_,_,_,_,_) = Lookup.lookupVar(cache,env, cr) "For crefs without value binding. If impl=true just silently fail" ;
then
fail();

Expand All @@ -1841,7 +1841,7 @@ algorithm
Values.Value v;
DAE.Exp dim;
equation
(cache,attr,tp,binding,_,_,_,_) = Lookup.lookupVar(cache,env, cr) ;
(cache,attr,tp,binding,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr) ;
(cache,Values.INTEGER(dimv),st_1) = ceval(cache,env, dim, impl, st, NONE, msg);
(cache,v) = cevalCrefBinding(cache,env, cr, binding, impl, msg);
v2 = cevalBuiltinSize2(v, dimv);
Expand Down Expand Up @@ -4344,7 +4344,7 @@ algorithm
// size(cr)
case (cache,env,DAE.CREF(componentRef = cr,ty = tp),impl,st,msg)
equation
(cache,_,tp,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr);
(cache,_,tp,_,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr);
sizelst = Types.getDimensionSizes(tp);
v = ValuesUtil.intlistToValue(sizelst);
then
Expand Down Expand Up @@ -4779,15 +4779,15 @@ algorithm
// Try to lookup the variables binding and constant evaluate it.
case (cache, env, c, impl, msg)
equation
(cache, _, _, binding, const_for_range, _, _, _) = Lookup.lookupVar(cache, env, c);
(cache, _, _, binding, const_for_range, _, _, _, _) = Lookup.lookupVar(cache, env, c);
(cache, v) = cevalCref2(cache, env, c, binding, const_for_range, impl, msg);
then
(cache, v);

// failure in lookup and we have the MSG go-ahead to print the error
case (cache,env,c,(impl as false),MSG())
equation
failure((_,_,_,_,_,_,_,_) = Lookup.lookupVar(cache,env, c));
failure((_,_,_,_,_,_,_,_,_) = Lookup.lookupVar(cache,env, c));
scope_str = Env.printEnvPathStr(env);
str = Exp.printComponentRefStr(c);
Error.addMessage(Error.LOOKUP_VARIABLE_ERROR, {str,scope_str});
Expand All @@ -4797,7 +4797,7 @@ algorithm
// failure in lookup but NO_MSG, silently fail and move along
case (cache,env,c,(impl as false),NO_MSG())
equation
failure((_,_,_,_,_,_,_,_) = Lookup.lookupVar(cache,env, c));
failure((_,_,_,_,_,_,_,_,_) = Lookup.lookupVar(cache,env, c));
then
fail();
end matchcontinue;
Expand Down Expand Up @@ -4878,7 +4878,7 @@ algorithm
Debug.fprint("tcvt", "+++++++ Ceval.cevalCrefBinding DAE.VALBOUND\n");
cr_1 = Exp.crefStripLastSubs(cr) "lookup without subscripts, so dimension sizes can be determined." ;
subsc = Exp.crefLastSubs(cr);
(cache,_,tp,_,_,_,_,_) = Lookup.lookupVar(cache, env, cr_1) "DAE.CREF_IDENT(id,{})" ;
(cache,_,tp,_,_,_,_,_,_) = Lookup.lookupVar(cache, env, cr_1) "DAE.CREF_IDENT(id,{})" ;
sizelst = Types.getDimensionSizes(tp);
(cache,res) = cevalSubscriptValue(cache, env, subsc, v, sizelst, impl, msg);
then
Expand Down Expand Up @@ -4908,7 +4908,7 @@ algorithm
false = stringEqual(rfn, "array");
cr_1 = Exp.crefStripLastSubs(cr) "lookup without subscripts, so dimension sizes can be determined." ;
subsc = Exp.crefLastSubs(cr);
(cache,_,tp,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr_1) "DAE.CREF_IDENT(id,{})" ;
(cache,_,tp,_,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr_1) "DAE.CREF_IDENT(id,{})" ;
sizelst = Types.getDimensionSizes(tp);
(cache,v,_) = ceval(cache, env, exp, impl, NONE, NONE, msg);
(cache,res) = cevalSubscriptValue(cache, env, subsc, v, sizelst, impl, msg);
Expand All @@ -4920,7 +4920,7 @@ algorithm
equation
cr_1 = Exp.crefStripLastSubs(cr) "lookup without subscripts, so dimension sizes can be determined." ;
subsc = Exp.crefLastSubs(cr);
(cache,_,tp,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr_1) "DAE.CREF_IDENT(id,{})" ;
(cache,_,tp,_,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr_1) "DAE.CREF_IDENT(id,{})" ;
sizelst = Types.getDimensionSizes(tp);
(cache,res) = cevalSubscriptValue(cache,env, subsc, e_val, sizelst, impl, msg);
then
Expand All @@ -4931,7 +4931,7 @@ algorithm
equation
cr_1 = Exp.crefStripLastSubs(cr) "lookup without subscripts, so dimension sizes can be determined." ;
subsc = Exp.crefLastSubs(cr);
(cache,_,tp,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr_1) "DAE.CREF_IDENT(id,{})" ;
(cache,_,tp,_,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr_1) "DAE.CREF_IDENT(id,{})" ;
sizelst = Types.getDimensionSizes(tp);
(cache,res)= cevalSubscriptValue(cache,env, subsc, e_val, sizelst, impl, msg);
then
Expand All @@ -4942,7 +4942,7 @@ algorithm
equation
cr_1 = Exp.crefStripLastSubs(cr) "lookup without subscripts, so dimension sizes can be determined." ;
subsc = Exp.crefLastSubs(cr);
(cache,_,tp,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr_1) "DAE.CREF_IDENT(id,{})" ;
(cache,_,tp,_,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr_1) "DAE.CREF_IDENT(id,{})" ;
sizelst = Types.getDimensionSizes(tp);
(cache,v,_) = ceval(cache,env, exp, impl, NONE, NONE, msg);
(cache,res) = cevalSubscriptValue(cache,env, subsc, v, sizelst, impl, msg);
Expand All @@ -4954,7 +4954,7 @@ algorithm
equation
cr_1 = Exp.crefStripLastSubs(cr) "lookup without subscripts, so dimension sizes can be determined." ;
subsc = Exp.crefLastSubs(cr);
(cache,_,tp,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr_1) "DAE.CREF_IDENT(id,{})" ;
(cache,_,tp,_,_,_,_,_,_) = Lookup.lookupVar(cache,env, cr_1) "DAE.CREF_IDENT(id,{})" ;
sizelst = Types.getDimensionSizes(tp);

// TODO: Ugly hack to prevent infinite recursion. If we have a binding r = r that
Expand Down
8 changes: 4 additions & 4 deletions Compiler/CevalScript.mo
Expand Up @@ -3382,7 +3382,7 @@ algorithm
classname_1 = Static.componentRefToPath(classname) "Check cached instantiated class" ;
Interactive.INSTCLASS(_,dae,env) = Interactive.getInstantiatedClass(ic, classname_1);
cref_1 = Exp.joinCrefs(cref, DAE.CREF_IDENT("stateSelect",DAE.ET_OTHER(),{}));
(cache,attr,ty,DAE.EQBOUND(exp,_,_),_,_,_,_) = Lookup.lookupVar(cache, env, cref_1);
(cache,attr,ty,DAE.EQBOUND(exp,_,_),_,_,_,_,_) = Lookup.lookupVar(cache, env, cref_1);
str = Exp.printExpStr(exp);
then
(cache,Values.STRING(str),st);
Expand All @@ -3407,7 +3407,7 @@ algorithm
(cache,env4,_,_,dae1,csets_1,ci_state_1,tys,_,_,_,_) = Inst.instClassIn(cache,env3, InnerOuter.emptyInstHierarchy,UnitAbsyn.noStore,DAE.NOMOD(), Prefix.NOPRE(), Connect.emptySet,
ci_state, c, false, {}, false, ConnectionGraph.EMPTY,NONE);
cref_1 = Exp.joinCrefs(cref, DAE.CREF_IDENT("stateSelect",DAE.ET_OTHER(),{}));
(cache,attr,ty,DAE.EQBOUND(exp,_,_),_,_,_,_) = Lookup.lookupVar(cache, env4, cref_1);
(cache,attr,ty,DAE.EQBOUND(exp,_,_),_,_,_,_,_) = Lookup.lookupVar(cache, env4, cref_1);
ic_1 = Interactive.addInstantiatedClass(ic, Interactive.INSTCLASS(classname_1,dae1,env4));
str = Exp.printExpStr(exp);
then
Expand All @@ -3424,7 +3424,7 @@ algorithm
classname_1 = Static.componentRefToPath(classname);
Interactive.INSTCLASS(_,dae,env) = Interactive.getInstantiatedClass(ic, classname_1);
cref_1 = Exp.joinCrefs(cref, DAE.CREF_IDENT(attribute,DAE.ET_OTHER(),{}));
(cache,attr,ty,DAE.VALBOUND(v),_,_,_,_) = Lookup.lookupVar(cache, env, cref_1);
(cache,attr,ty,DAE.VALBOUND(v),_,_,_,_,_) = Lookup.lookupVar(cache, env, cref_1);
then
(cache,v,st);

Expand All @@ -3448,7 +3448,7 @@ algorithm
(cache,env4,_,_,dae1,csets_1,ci_state_1,tys,_,_,_,_) = Inst.instClassIn(cache,env3, InnerOuter.emptyInstHierarchy, UnitAbsyn.noStore,DAE.NOMOD(), Prefix.NOPRE(), Connect.emptySet,
ci_state, c, false, {}, false, ConnectionGraph.EMPTY,NONE);
cref_1 = Exp.joinCrefs(cref, DAE.CREF_IDENT(attribute,DAE.ET_OTHER(),{}));
(cache,attr,ty,DAE.VALBOUND(v),_,_,_,_) = Lookup.lookupVar(cache, env4, cref_1);
(cache,attr,ty,DAE.VALBOUND(v),_,_,_,_,_) = Lookup.lookupVar(cache, env4, cref_1);
ic_1 = Interactive.addInstantiatedClass(ic, Interactive.INSTCLASS(classname_1,dae1,env4));
then
(cache,v,Interactive.SYMBOLTABLE(p,aDep,sp,ic_1,vars,cf,lf));
Expand Down
12 changes: 6 additions & 6 deletions Compiler/Cevalfunc.mo
Expand Up @@ -1067,7 +1067,7 @@ algorithm outVal := matchcontinue(inVal,env,toAssign)
// records
case(value as Values.RECORD(_,vals,names,-1),env,Absyn.CREF(Absyn.CREF_IDENT(str,subs)))
equation
(_,_,t as (DAE.T_COMPLEX(_,typeslst,_,_),_),_,_,_,_,_) = Lookup.lookupVar(Env.emptyCache(),env, DAE.CREF_IDENT(str,DAE.ET_OTHER(),{}));
(_,_,t as (DAE.T_COMPLEX(_,typeslst,_,_),_),_,_,_,_,_,_) = Lookup.lookupVar(Env.emptyCache(),env, DAE.CREF_IDENT(str,DAE.ET_OTHER(),{}));
nlist = setValuesInRecord(typeslst,names,vals);
fr = Env.newFrame(false);
complexEnv = makeComplexEnv({fr},nlist);
Expand All @@ -1080,15 +1080,15 @@ algorithm outVal := matchcontinue(inVal,env,toAssign)
// any other values with ident cref
case(value,env,Absyn.CREF(Absyn.CREF_IDENT(str,subs)))
equation
(_,_,t,DAE.VALBOUND(value2),_,_,_,_) = Lookup.lookupVar(Env.emptyCache(),env, DAE.CREF_IDENT(str,DAE.ET_OTHER(),{}));
(_,_,t,DAE.VALBOUND(value2),_,_,_,_,_) = Lookup.lookupVar(Env.emptyCache(),env, DAE.CREF_IDENT(str,DAE.ET_OTHER(),{}));
value = mergeValues(value2,value,subs,env,t);
env1 = updateVarinEnv(env,str,value,t);
then
env1;
// any other values with qualified cref
case(value,env,me as Absyn.CREF(Absyn.CREF_QUAL(str,subs,child)))
equation
(_,_,t,DAE.VALBOUND(value2),_,_,_,_) = Lookup.lookupVar(Env.emptyCache(),env, DAE.CREF_IDENT(str,DAE.ET_OTHER(),{}));
(_,_,t,DAE.VALBOUND(value2),_,_,_,_,_) = Lookup.lookupVar(Env.emptyCache(),env, DAE.CREF_IDENT(str,DAE.ET_OTHER(),{}));
env1 = setQualValue(env,value,Absyn.CREF_QUAL(str,subs,child));
then
env1;
Expand Down Expand Up @@ -1149,7 +1149,7 @@ algorithm oenv := matchcontinue(env,inVal,inCr)
case( ( (frame as Env.FRAME(farg1, farg2, farg3, farg4, farg6, farg7,defineUnits) ) :: frames),inVal,inCr)
equation
str = Absyn.crefFirstIdent(inCr);
(_,_,_,_,_,_,_,_) = Lookup.lookupVar(Env.emptyCache(), {frame}, DAE.CREF_IDENT(str,DAE.ET_OTHER(),{}));
(_,_,_,_,_,_,_,_,_) = Lookup.lookupVar(Env.emptyCache(), {frame}, DAE.CREF_IDENT(str,DAE.ET_OTHER(),{}));
farg22 = setQualValue2(farg2, inVal,inCr,0);
then
Env.FRAME(farg1,farg22,farg3,farg4,farg6,farg7,defineUnits) :: frames;
Expand Down Expand Up @@ -1244,7 +1244,7 @@ algorithm

case(env,varName,newVal,ty)
equation
(_,_,t,_,_,_,_,_) = Lookup.lookupVar(Env.emptyCache(), env,DAE.CREF_IDENT(varName,DAE.ET_OTHER(),{}));
(_,_,t,_,_,_,_,_,_) = Lookup.lookupVar(Env.emptyCache(), env,DAE.CREF_IDENT(varName,DAE.ET_OTHER(),{}));
// print("updateVarinEnv -> component: " +& varName +& " ty: " +& Types.printTypeStr(ty) +& "\n");
// print("updateVarinEnv -> component: " +& varName +& " ACTUAL ty: " +& Types.printTypeStr(t) +& "\n");
env1 = Env.updateFrameV(env,
Expand Down Expand Up @@ -1502,7 +1502,7 @@ algorithm
case({},_) then {};
case(((ele1 as SCode.COMPONENT(component = varName, attributes = SCode.ATTR(direction = Absyn.OUTPUT() ) ))::eles1),env)
equation
(_,_,_,DAE.VALBOUND(value),_,_,_,_) = Lookup.lookupVar(Env.emptyCache(),env, DAE.CREF_IDENT(varName,DAE.ET_OTHER(),{}));
(_,_,_,DAE.VALBOUND(value),_,_,_,_,_) = Lookup.lookupVar(Env.emptyCache(),env, DAE.CREF_IDENT(varName,DAE.ET_OTHER(),{}));
lval = getOutputVarValues(eles1,env);
then
value::lval;
Expand Down
6 changes: 3 additions & 3 deletions Compiler/ConnectUtil.mo
Expand Up @@ -1437,7 +1437,7 @@ algorithm
case (cache,{},_,_,_) then (cache,DAEUtil.emptyDae);
case (cache,(cr :: xs),env,prefix,deletedComponents)
equation
(cache,_,tp,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr);
(cache,_,tp,_,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr);
true = Types.isArray(tp); // For variables that are arrays, generate cr = fill(0,dims);
dimSizes = Types.getDimensionSizes(tp);
(_,dimSizesOpt) = Types.flattenArrayTypeOpt(tp);
Expand All @@ -1452,7 +1452,7 @@ algorithm
(cache,res);
case (cache,(cr :: xs),env,prefix,deletedComponents) // For scalars.
equation
(cache,_,tp,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr);
(cache,_,tp,_,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr);
false = Types.isArray(tp); // scalar
(cache,DAE.DAE(elts,funcs)) = generateZeroflowEquations(cache,xs,env,prefix,deletedComponents);
cr2 = PrefixUtil.prefixCref(prefix,cr);
Expand Down Expand Up @@ -1953,7 +1953,7 @@ algorithm
// is a qualified cref and is a connector => OUTSIDE
case (env,ih,DAE.CREF_QUAL(ident = id,componentRef = cr))
equation
(_,_,(DAE.T_COMPLEX(complexClassType=ClassInf.CONNECTOR(_,_)),_),_,_,_,_,_)
(_,_,(DAE.T_COMPLEX(complexClassType=ClassInf.CONNECTOR(_,_)),_),_,_,_,_,_,_)
= Lookup.lookupVar(Env.emptyCache(),env,DAE.CREF_IDENT(id,DAE.ET_OTHER(),{}));
then Connect.OUTSIDE();

Expand Down
16 changes: 8 additions & 8 deletions Compiler/InnerOuter.mo
Expand Up @@ -844,8 +844,8 @@ algorithm
// if it was not added, add it (search for both components)
case(cache,env,ih,pre,setLst,false,cr1,io1,f1,cr2,io2,f2,info)
equation
(cache,DAE.ATTR(flowPrefix,_,_,vt1,_,_),t1,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr1);
(cache,DAE.ATTR( _,_,_,vt2,_,_),t2,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr2);
(cache,DAE.ATTR(flowPrefix,_,_,vt1,_,_),t1,_,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr1);
(cache,DAE.ATTR( _,_,_,vt2,_,_),t2,_,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr2);
io1 = removeOuter(io1);
io2 = removeOuter(io2);
(cache,env,ih,csets as Connect.SETS(setLst=setLst2),dae,_) =
Expand Down Expand Up @@ -907,7 +907,7 @@ algorithm
// if it was not added, add it (first component found: cr1)
case(cache,env,ih,pre,setLst,false,cr1,io1,f1,cr2,io2,f2,info)
equation
(cache,DAE.ATTR(flowPrefix=flow_,parameter_=vt1),t1,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr1);
(cache,DAE.ATTR(flowPrefix=flow_,parameter_=vt1),t1,_,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr1);
pre = Prefix.NOPRE();
t2 = t1;
vt2 = vt1;
Expand All @@ -924,7 +924,7 @@ algorithm
case(cache,env,ih,pre,setLst,false,cr1,io1,f1,cr2,io2,f2,info)
equation
pre = Prefix.NOPRE();
(cache,DAE.ATTR(flowPrefix=flow_,parameter_=vt2),t2,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr2);
(cache,DAE.ATTR(flowPrefix=flow_,parameter_=vt2),t2,_,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr2);
t1 = t2;
vt1 = vt2;
io1 = removeOuter(io1);
Expand Down Expand Up @@ -976,8 +976,8 @@ algorithm
case(cache,env,ih,cr1,cr2)
equation
ErrorExt.setCheckpoint("lookupVarInnerOuterAttr");
(_,DAE.ATTR(innerOuter=io1),_,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr1);
(_,DAE.ATTR(innerOuter=io2),_,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr2);
(_,DAE.ATTR(innerOuter=io1),_,_,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr1);
(_,DAE.ATTR(innerOuter=io2),_,_,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr2);
(isInner1,isOuter1) = innerOuterBooleans(io1);
(isInner2,isOuter2) = innerOuterBooleans(io2);
isInner = isInner1 or isInner2;
Expand All @@ -988,15 +988,15 @@ algorithm
// try to find var cr1 (lookup can fail for one of them)
case(cache,env,ih,cr1,cr2)
equation
(_,DAE.ATTR(innerOuter=io),_,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr1);
(_,DAE.ATTR(innerOuter=io),_,_,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr1);
(isInner,isOuter) = innerOuterBooleans(io);
ErrorExt.rollBack("lookupVarInnerOuterAttr");
then
(isInner,isOuter);
// ..else try cr2 (lookup can fail for one of them)
case(cache,env,ih,cr1,cr2)
equation
(_,DAE.ATTR(innerOuter=io),_,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr2);
(_,DAE.ATTR(innerOuter=io),_,_,_,_,_,_,_) = Lookup.lookupVar(cache,env,cr2);
(isInner,isOuter) = innerOuterBooleans(io);
ErrorExt.rollBack("lookupVarInnerOuterAttr");
then (isInner,isOuter);
Expand Down

0 comments on commit cdb205f

Please sign in to comment.