diff --git a/src/expandPack.ml b/src/expandPack.ml index 90ccf26db2137db3ec4e7143cf044ef77b1ac073..9b2c3af1d6e17d53a41979359d16587a47f4b7ee 100644 --- a/src/expandPack.ml +++ b/src/expandPack.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 29/05/2008 (at 14:17) by Erwan Jahier> *) +(** Time-stamp: <modified the 29/05/2008 (at 15:01) by Erwan Jahier> *) open Lxm open SyntaxTree @@ -104,6 +104,23 @@ let (doit: ) (* check_arg *) in + let (sargs_pack : Ident.pack_name srcflagged list) = + List.fold_left + (fun acc arg -> + (match arg.it with + | StaticArgIdent(idref) -> + (match Ident.pack_of_idref idref with + | None -> acc + | Some p -> + let p_flagged = Lxm.flagit p arg.src in + if List.mem p_flagged acc then acc else p_flagged::acc + ) + | _ -> acc + ) + ) + [] + args + in let pars_nb = string_of_int (List.length pars) and args_nb = string_of_int (List.length args) in try ( @@ -135,8 +152,8 @@ let (doit: | None -> None in let pg = { - (* les uses du modèle ... *) - pg_uses = mi.it.mo_uses ; + (* les uses du modèle + les packages utilisés par les arg statiques *) + pg_uses = mi.it.mo_uses @ sargs_pack; pg_provides = prov ; pg_body = body ; } in diff --git a/src/test/test.res.exp b/src/test/test.res.exp index 4a3f52eee38c40c69d14f89745ebda4aec78242e..0364ea0a9f6c5a32bc0546bdbefb7063a901a987 100644 --- a/src/test/test.res.exp +++ b/src/test/test.res.exp @@ -13193,8 +13193,25 @@ type TestCondact__t1 = int; type TestCondact__t2 = int; Exported constants: Exported nodes: -*** Error in file "should_work/packEnvTest/Condact.lus", line 21, col 42 to 52, token 'Util::carre': unknown node (carre) - +node TestCondact__n(e:int) returns (s:int); +let + s = Util__carre(e); +tel +-- end of node TestCondact__n +node TestCondact__C(c:bool; d:int; x:int) returns (y:int); +let + y = if (c) then (current (TestCondact__n(x))) else (d -> pre(y)); +tel +-- end of node TestCondact__C + * package Main + Exported types: + Exported constants: + Exported nodes: +node Main__Condact(c:bool; d:int; x:int) returns (y:int); +let + y = TestCondact__C(c, d, x); +tel +-- end of node Main__Condact ---------------------------------------------------------------------- ====> ../lus2lic -vl 3 --compile-all-items should_work/packEnvTest/contractForElementSelectionInArray/contractForElementSelectionInArray.lus