Octachron / codept

Contextual Ocaml DEPendencies Tool: alternative ocaml dependency analyzer
Other
59 stars 10 forks source link

flag -dot should special case some identifiers #2

Closed raphael-proust closed 6 years ago

raphael-proust commented 6 years ago

When generating a dot file with the -dot option, a file name node.ml will cause a node of the dependency graph to be named Node. This is invalid in Dot

I think that node [ name = Node ] or something along those lines would work.

Other problematic identifiers: graph, edge, digraph, subgraph.

Octachron commented 6 years ago

Thanks for the report! This is fixed in master by escaping graphviz keywords as "keyword" when needed. This bug fix should be part of the next release by the end of the month.

raphael-proust commented 6 years ago

LGTM

raphael-proust commented 6 years ago

Works in my use case. But I just realised another possible issue: modules with more caps.

$ echo "open EDGE" > NODE.ml
$ touch EDGE.ml
$ codept -dot *.ml | dot
Error: <stdin>: syntax error in line 2 near '->'

The escaping needs to be applied regardless of capitalisation.