Open modules _before_ static scoping

This commit is contained in:
Cédric Pasteur 2011-09-05 15:32:42 +02:00
parent 379f509dfc
commit 78fe2d2fce
2 changed files with 5 additions and 1 deletions

View file

@ -532,7 +532,6 @@ let translate_program p =
| Ptype t -> Heptagon.Ptype (translate_typedec t)
| Pnode n -> Heptagon.Pnode (translate_node n)
in
List.iter open_module p.p_opened;
let desc = List.map translate_program_desc p.p_desc in
{ Heptagon.p_modname = Names.modul_of_string p.p_modname;
Heptagon.p_opened = p.p_opened;

View file

@ -67,9 +67,14 @@ let const_dec funs local_const cd =
add_const c_name (Signature.mk_const_def Types.Tinvalid (Initial.mk_static_string "invalid"));
cd, local_const
let interface_desc _ local_const id = match id with
| Iopen n -> open_module n; id, local_const
| _ -> raise Errors.Fallback
let program p =
let funs = { Hept_parsetree_mapfold.defaults
with node_dec = node; exp = exp; static_exp = static_exp; const_dec = const_dec } in
List.iter open_module p.p_opened;
let p, _ = Hept_parsetree_mapfold.program_it funs Names.NamesSet.empty p in
p