@@ -198,7 +198,7 @@ relation instantiate_class : (SCode.Program, SCode.Path) => DAE.DAElist =
198198
199199 rule Builtin.initial_env => env &
200200 inst_class_decls(env,cdecls,path)=> (env',_) &
201- Lookup.lookup_class(env',path) => (cdef, env'') &
201+ Lookup.lookup_class(env',path,true ) => (cdef, env'') &
202202 inst_class(env'',Mod.NOMOD,Prefix.NOPRE,[],cdef,[],false) => (dae,_,_,_) &
203203 Absyn.path_string path => pathstr
204204 --------------------------------------------
@@ -356,15 +356,15 @@ relation inst_class : (Env, Mod, Prefix, Connect.Sets, SCode.Class, InstDims,boo
356356 ------------------------------------------------------
357357 inst_class(env,mod,pre, csets, SCode.CLASS(n,true,_,_,_),_,false) => fail
358358
359- rule Env.open_scope(env) => env' &
359+ rule Env.open_scope(env,encflag ) => env' &
360360 ClassInf.start(r,n) => ci_state &
361361 inst_class_in(env', mod, pre, csets, ci_state, c, false,inst_dims,impl)
362362 => (dae1,_,csets',ci_state', tys) &
363363 Connect.equations csets' => dae2 &
364364 list_append(dae1, dae2) => dae &
365365 mktype(ci_state',tys) => ty
366366 -------------------------------------------
367- inst_class(env, mod, pre, csets, c as SCode.CLASS(n,_,_ ,r,_),inst_dims,impl)
367+ inst_class(env, mod, pre, csets, c as SCode.CLASS(n,_,encflag ,r,_),inst_dims,impl)
368368 => (dae, [], ty,ci_state')
369369
370370 rule Print.print_buf "- inst_class " & Print.print_buf n & Print.print_buf " failed\n"
@@ -446,7 +446,7 @@ relation inst_classdef: (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
446446 rule Prefix.print_prefix_str pre => prestr &
447447 Absyn.path_string cn => cnstr &
448448 Debug.fprintl ("insttr", ["inst_class derived: ", cnstr, ", pre=",prestr,"\n"]) &
449- Lookup.lookup_class(env,cn) => (c as SCode.CLASS(cn2,_,_,r,_), cenv) &
449+ Lookup.lookup_class(env,cn,true ) => (c as SCode.CLASS(cn2,_,_,r,_), cenv) &
450450 Mod.lookup_modification_p(mods,cn) => m &
451451 Mod.elab_mod(env,pre,mod) => mod' &
452452 ClassInf.start(r, cn2) => new_ci_state &
@@ -466,7 +466,7 @@ relation inst_classdef: (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
466466 (** found in the environment, this rule prints an error *)
467467 (** message. *)
468468
469- rule not Lookup.lookup_class(env,cn) => (_,_) &
469+ rule not Lookup.lookup_class(env,cn,false ) => (_,_) &
470470 Absyn.path_string(cn) => cns &
471471 Print.print_buf "# unknown class: " & Print.print_buf cns & Print.print_buf "\n"
472472 ----------------------------------------
@@ -573,7 +573,7 @@ relation extend_components_to_env : (Env, Mod, Prefix, Connect.Sets, ClassInf.St
573573 SCode.Element list, InstDims, bool)
574574 => (Env) =
575575
576- rule Lookup.lookup_class(env,t) => (cl,cenv) &
576+ rule Lookup.lookup_class(env,t,true ) => (cl,cenv) &
577577 Debug.fprint ("decl", "got class \n") &
578578
579579 (** PA: PROBLEM, Modifiers should be merged in this phase, but
@@ -659,7 +659,7 @@ relation inst_element : (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
659659
660660 rule Absyn.path_string(cn) => cns &
661661 Debug.fprintln ("insttr", "Looking for base class") &
662- Lookup.lookup_class(env,cn) => (c as SCode.CLASS(cn2,_,_,restr,def), cenv) &
662+ Lookup.lookup_class(env,cn,true ) => (c as SCode.CLASS(cn2,_,_,restr,def), cenv) &
663663 Debug.fprintln ("insttr", "Base class found") &
664664 Mod.lookup_modification_p(mods,cn) => classmod &
665665 Debug.fprintln ("insttr", "Modifications fetched") &
@@ -705,7 +705,7 @@ relation inst_element : (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
705705 SCode.CLASSDEF(n,_,_,_),_,_)
706706 => fail
707707
708- rule Lookup.lookup_class(env,Absyn.IDENT(n)) => (_,_) &
708+ rule Lookup.lookup_class(env,Absyn.IDENT(n),false ) => (_,_) &
709709 Print.print_buf "# Trying to redeclare the variable " & Print.print_buf n &
710710 Print.print_buf " as a class\n"
711711 ---------------------
@@ -772,7 +772,7 @@ relation inst_element : (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
772772 Debug.fcall("insttr",Env.print_env,env) &
773773 Debug.fprint("insttr"," \n") &
774774
775- Lookup.lookup_class(env,t) => (cl,cenv) &
775+ Lookup.lookup_class(env,t,true ) => (cl,cenv) &
776776
777777 Debug.fprintl ("insttr", ["found type for: ", n, "\n"]) &
778778 Debug.fprintln ("insttr", "Looking up class modifications") &
@@ -848,7 +848,7 @@ relation inst_element : (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
848848 **)
849849
850850 (** Failure *)
851- rule not Lookup.lookup_class(env,t) => (cl,cenv) &
851+ rule not Lookup.lookup_class(env,t,false ) => (cl,cenv) &
852852 Absyn.path_string(t) => s &
853853 Print.print_buf "# unknown class '" & Print.print_buf s & Print.print_buf "' while instantiating " &
854854 Prefix.prefix_add(n,[],pre) => pre' &
@@ -1105,7 +1105,7 @@ relation update_variable_in_env: (Mod.Mod,Absyn.ComponentRef, Env.Env, bool)
11051105 attr as SCode.ATTR(ad,flow,acc,param,dir),
11061106 t,m)),_) &
11071107
1108- Lookup.lookup_class(env,t) => (cl,cenv) &
1108+ Lookup.lookup_class(env,t,false ) => (cl,cenv) &
11091109
11101110 get_cref_from_mod(m) => crefs &
11111111 update_variables_in_env(mods,crefs,env,impl) => env2' &
@@ -2046,7 +2046,7 @@ end
20462046(** HJ: **)
20472047relation add_for_loop_scope : (Env.Env, Ident, Types.Type) => Env.Env =
20482048
2049- rule Env.open_scope env => env' &
2049+ rule Env.open_scope ( env,false) => env' &
20502050 Env.extend_frame_v(env',
20512051 Types.VAR(i,
20522052 Types.ATTR(false,
@@ -2414,7 +2414,7 @@ relation unroll : (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
24142414
24152415 axiom unroll (_,_,_,csets,_,_,Values.ARRAY([]),_) => ([], csets)
24162416
2417- rule Env.open_scope env => env' &
2417+ rule Env.open_scope ( env,false) => env' &
24182418 Env.extend_frame_v (env',
24192419 Types.VAR(i, Types.ATTR(false,
24202420 SCode.RO,
@@ -3061,7 +3061,7 @@ relation inst_record_constructor_elt : (Env.Env,SCode.Element) =>
30613061 rule Debug.fprint ("recconst", "inst_record_constructor_elt called\n") &
30623062 elab_arraydim(env,dim,NONE,true,NONE) => dimexp &
30633063 Debug.fprint ("recconst", "elaborated arraydim\n") &
3064- Lookup.lookup_class(env,t) => (cl,cenv) &
3064+ Lookup.lookup_class(env,t,true ) => (cl,cenv) &
30653065 Debug.fprint ("recconst", "looked up class\n") &
30663066 Mod.elab_mod(env,Prefix.NOPRE,mod) => mod' &
30673067
0 commit comments