[parser] avoid redefinition of nodes

This commit is contained in:
dsac 2022-12-14 18:41:59 +01:00
parent 79f0c7d223
commit 73d5ed7726

View File

@ -195,7 +195,12 @@ node_content:
n_automata = aut;
n_inputs_type = t_in;
n_outputs_type = t_out; } in
Hashtbl.add defined_nodes node_name n; n };
if Hashtbl.find_opt defined_nodes node_name <> None
then raise (MyParsingError
(Format.asprintf "The node %s is already defined."
node_name,
current_location()))
else Hashtbl.add defined_nodes node_name n; n };
node_body:
| /* empty */ { ([], []) }