fix the bug in CCGraph

This commit is contained in:
Simon Cruanes 2017-02-13 15:26:52 +01:00
parent 38f5692e21
commit 207a5725de

View file

@ -252,16 +252,16 @@ module Traverse = struct
bag.push (`Enter (v, [])); bag.push (`Enter (v, []));
while not (bag.is_empty ()) do while not (bag.is_empty ()) do
match bag.pop () with match bag.pop () with
| `Enter (x, path) -> | `Enter (v, path) ->
if not (tags.get_tag x) then ( if not (tags.get_tag v) then (
let num = !n in let num = !n in
incr n; incr n;
tags.set_tag x; tags.set_tag v;
k (`Enter (x, num, path)); k (`Enter (v, num, path));
bag.push (`Exit x); bag.push (`Exit v);
Seq.iter Seq.iter
(fun (e,v') -> bag.push (`Edge (v,e,v',(v,e,v') :: path))) (fun (e,v') -> bag.push (`Edge (v,e,v',(v,e,v') :: path)))
(graph x); (graph v);
) )
| `Exit x -> k (`Exit x) | `Exit x -> k (`Exit x)
| `Edge (v,e,v', path) -> | `Edge (v,e,v', path) ->