Couper les commentaires et espaces situés après les labels d'arcs.

This commit is contained in:
Didier Le Botlan 2023-11-23 12:00:32 +01:00
parent bd0f9c41ac
commit 54bea1fb39

View file

@ -66,7 +66,7 @@ let ensure graph id = if node_exists graph id then graph else new_node graph id
(* Reads a line with an arc. *)
let read_arc graph line =
try Scanf.sscanf line "e %d %d %_d %s@%%"
(fun src tgt lbl -> new_arc (ensure (ensure graph src) tgt) { src ; tgt ; lbl } )
(fun src tgt lbl -> let lbl = String.trim lbl in new_arc (ensure (ensure graph src) tgt) { src ; tgt ; lbl } )
with e ->
Printf.printf "Cannot read arc in line - %s:\n%s\n%!" (Printexc.to_string e) line ;
failwith "from_file"