Skip to content

Instantly share code, notes, and snippets.

@awreece
Created December 8, 2012 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awreece/4239062 to your computer and use it in GitHub Desktop.
Save awreece/4239062 to your computer and use it in GitHub Desktop.
ocamlgraph dot patch
$ svn diff
Index: src/dot.ml
===================================================================
--- src/dot.ml (revision 453)
+++ src/dot.ml (working copy)
@@ -147,15 +147,15 @@
let al = Attr.addl !def_edge_attr al in
let el = L.edge [Attr.list al] in
let g,vn = node g id [] in
- List.fold_left
- (fun g m -> match m with
- | NodeId idm ->
- let g,vm = node g idm [] in
- let e = B.G.E.create vn el vm in
- B.add_edge_e g e
- | NodeSub _ ->
- g)
- g nl
+ fst (List.fold_left
+ (fun (g,pvn) m -> match m with
+ | NodeId idm ->
+ let g,vm = node g idm [] in
+ let e = B.G.E.create pvn el vm in
+ ((B.add_edge_e g e),vm)
+ | NodeSub _ ->
+ (g,pvn))
+ (g,vn) nl)
| Attr_edge al ->
def_edge_attr := Attr.addl !def_edge_attr al; g
| Subgraph (SubgraphDef (_, stmts)) ->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment