diff --git a/src/nodesExpand.ml b/src/nodesExpand.ml index f8fc956dffe553e75588600dca156325c4d5b28e..ed69ae7230bccce3bf65ce560215cd31af9b41ae 100644 --- a/src/nodesExpand.ml +++ b/src/nodesExpand.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 11/03/2009 (at 16:18) by Erwan Jahier> *) +(** Time-stamp: <modified the 11/03/2009 (at 16:41) by Erwan Jahier> *) (** nb : only user nodes are expanded. @@ -108,8 +108,8 @@ let (get_node_body : Eff.local_env -> Eff.node_exp -> Eff.node_body option) = (********************************************************************************) type subst = (var_info * var_info) list -let rec (substitute : subst -> Eff.eq_info Lxm.srcflagged -> - Eff.eq_info Lxm.srcflagged) = +let rec (substitute : + subst -> Eff.eq_info Lxm.srcflagged -> Eff.eq_info Lxm.srcflagged) = fun s { it = (lhs,ve) ; src = lxm } -> let lhs = List.map (subst_in_left s) lhs in let newve = subst_in_val_exp s ve in @@ -148,8 +148,12 @@ and (subst_in_val_exp : subst -> val_exp -> val_exp) = | WITH(ve) -> WITH(subst_in_val_exp s ve) | HAT(i,ve) -> HAT(i, subst_in_val_exp s ve) | ARRAY(vel) -> ARRAY(List.map (subst_in_val_exp s) vel) - - | Predef _| CALL _ | PRE | ARROW | FBY | CURRENT | WHEN _ | TUPLE + | WHEN(SyntaxTreeCore.Base) -> WHEN(SyntaxTreeCore.Base) + | WHEN(SyntaxTreeCore.NamedClock {src=lxm;it=(cc,cv)}) -> + let var = snd(List.find (fun (v,_) -> v.var_name_eff = cv) s) in + let cv = var.var_name_eff in + WHEN(SyntaxTreeCore.NamedClock {src=lxm;it=(cc,cv)}) + | Predef _| CALL _ | PRE | ARROW | FBY | CURRENT | TUPLE | CONCAT | STRUCT_ACCESS _ | ARRAY_ACCES _ | ARRAY_SLICE _ | MERGE _ (* | CONST _ *) -> by_pos_op diff --git a/src/test/should_work/lionel/clock.lus b/src/test/should_work/lionel/clock.lus index 0a6ef6e0fa637482bffe5f1c5fab369185cf92f1..9db63116dfb17fb00020b954528e12f68918cc5d 100644 --- a/src/test/should_work/lionel/clock.lus +++ b/src/test/should_work/lionel/clock.lus @@ -1,3 +1,4 @@ + node n1(ck : bool) returns (out : int when ck; ckout : bool); var cpt : int; let @@ -6,7 +7,6 @@ let ckout = ck; tel - node system(ck1 : bool) returns (out : int); var ckout : bool; @@ -17,6 +17,7 @@ let tel + node n2(ck : bool; in : int) returns (out : int when ck); let out = in when ck;