Better styling
This commit is contained in:
@ -132,8 +132,8 @@ module Make (M: PrintableType) = struct
|
||||
}
|
||||
|
||||
let addToLastNode (newcontent: elt) (cfg: t) : t =
|
||||
match cfg.empty with
|
||||
| true -> let newnode = Node.create () in
|
||||
if cfg.empty then
|
||||
let newnode = Node.create () in
|
||||
{ empty = false;
|
||||
nodes = NodeSet.singleton newnode;
|
||||
edges = NodeMap.empty;
|
||||
@ -144,7 +144,7 @@ module Make (M: PrintableType) = struct
|
||||
terminal = Some newnode;
|
||||
content = NodeMap.singleton newnode [newcontent]
|
||||
}
|
||||
| false ->
|
||||
else
|
||||
let prevcfgterminal = Option.get cfg.terminal in
|
||||
{ cfg with
|
||||
content = (NodeMap.add_to_list_last
|
||||
|
||||
@ -75,13 +75,15 @@ module Make (M: Cfg.PrintableType) (I: Cfg.PrintableType) = struct
|
||||
let pp (ppf: out_channel) (c: t) : unit = (
|
||||
Printf.fprintf ppf "Cfg:\n";
|
||||
Printf.fprintf ppf "Nodes' ids: ";
|
||||
List.iter (fun (x : Node.t) -> Printf.fprintf ppf "%d " x.id) (NodeSet.to_list c.t.nodes);
|
||||
List.iter (fun (x : Node.t) ->
|
||||
Printf.fprintf ppf "%d " x.id) (NodeSet.to_list c.t.nodes);
|
||||
Printf.fprintf ppf "\n";
|
||||
|
||||
Printf.fprintf ppf "Nodes' edges:\n";
|
||||
List.iter (fun ((n, (a, b)) : (Node.t * (Node.t * Node.t option))) : unit ->
|
||||
match b with None -> Printf.fprintf ppf "\t%d -> %d\n" n.id a.id
|
||||
| Some b -> Printf.fprintf ppf "\t%d -> %d, %d\n" n.id a.id b.id
|
||||
match b with
|
||||
None -> Printf.fprintf ppf "\t%d -> %d\n" n.id a.id
|
||||
| Some b -> Printf.fprintf ppf "\t%d -> %d, %d\n" n.id a.id b.id
|
||||
) (NodeMap.to_list c.t.edges);
|
||||
Printf.fprintf ppf "\n";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user