Project

General

Profile

Revision 95944ba1 src/modules.ml

View differences:

src/modules.ml
27 27
let add_imported_node name value =
28 28
(*Format.eprintf "add_imported_node %s %a (owner=%s)@." name Printers.pp_imported_node (imported_node_of_top value) value.top_decl_owner;*)
29 29
  try
30
    let value' = Hashtbl.find node_table name in
30
    let value' = node_from_name name in
31 31
    let owner' = value'.top_decl_owner in
32 32
    let itf' = value'.top_decl_itf in
33 33
    let owner = value.top_decl_owner in
34 34
    let itf = value.top_decl_itf in
35 35
    match value'.top_decl_desc, value.top_decl_desc with
36
    | Node _        , ImportedNode _  when owner = owner' && itf' && (not itf) -> Hashtbl.add node_table name value
36
    | Node _        , ImportedNode _  when owner = owner' && itf' && (not itf) -> update_node name value
37 37
    | ImportedNode _, ImportedNode _            -> raise (Error (value.top_decl_loc, Error.Already_bound_symbol ("node " ^ name)))
38 38
    | _                                         -> assert false
39 39
  with
40
    Not_found                                   -> Hashtbl.add node_table name value
40
    Not_found                                   -> update_node name value
41 41

  
42 42
let add_node name value =
43 43
(*Format.eprintf "add_node %s %a (owner=%s)@." name Printers.pp_imported_node (get_node_interface (node_of_top value)) value.top_decl_owner;*)
44 44
  try
45
    let value' = Hashtbl.find node_table name in
45
    let value' = node_from_name name in
46 46
    let owner' = value'.top_decl_owner in
47 47
    let itf' = value'.top_decl_itf in
48 48
    let owner = value.top_decl_owner in
......
52 52
    | Node _        , Node _                    -> raise (Error (value.top_decl_loc, Error.Already_bound_symbol ("node " ^ name)))
53 53
    | _                                         -> assert false
54 54
  with
55
    Not_found                                   -> Hashtbl.add node_table name value
55
    Not_found                                   -> update_node name value
56 56

  
57 57

  
58 58
let add_tag loc name typ =

Also available in: Unified diff