Project

General

Profile

Revision 990210f3 src/lusic.ml

View differences:

src/lusic.ml
31 31
(* extracts a header from a program representing module owner = dirname/basename *)
32 32
let extract_header dirname basename prog =
33 33
  let owner = dirname ^ "/" ^ basename in
34
 List.fold_right
35
   (fun decl header ->
36
     (*Format.eprintf "Lusic.extract_header: header = %B, owner = %s, decl_owner = %s@." decl.top_decl_itf owner decl.top_decl_owner;*)
37
     if decl.top_decl_itf || decl.top_decl_owner <> owner then header else
38
    match decl.top_decl_desc with
39
    | Node nd        -> { decl with top_decl_desc = ImportedNode (Corelang.get_node_interface nd) } :: header 
40
    | ImportedNode _ -> header
41
    | Const _
42
    | TypeDef _
43
    | Open _         -> decl :: header)
44
   prog []
34
  List.fold_right
35
    (fun decl header ->
36
      (*Format.eprintf "Lusic.extract_header: header = %B, owner = %s, decl_owner = %s@." decl.top_decl_itf owner decl.top_decl_owner;*)
37
      if decl.top_decl_itf || decl.top_decl_owner <> owner then header else
38
	match decl.top_decl_desc with
39
	| Node nd        -> { decl with top_decl_desc = ImportedNode (Corelang.get_node_interface nd) } :: header 
40
	| ImportedNode _ -> header
41
	| Const _
42
	| TypeDef _
43
	| Open _         -> decl :: header)
44
    prog []
45 45

  
46 46
let check_obsolete lusic basename =
47 47
  if lusic.obsolete then raise (Error (Location.dummy_loc, Wrong_number basename))

Also available in: Unified diff