By the way: it is in general a good thing that dot automatically
inserts a node "x" by default if it is referenced
in an edge "x -> y" and "x" has not been declared before.
But sometimes a typo might be involved so that an unintended
edge is created! This case might be difficult to spot
in a large graph.
The "declare before use" paradigm served a purpose
in programming languages, so maybe it is useful in
this case too.
So I suggest to introduce a command line option that
warns if an edge references an (previously?) unseen node.
What do you think?
Thank you very much in advance. This is really a great tool to work with.
[erg] Line numbers on warnings will involve code change. We could decide to maintain line numbers in the graph, but because nodes and edges can be used multiple times, line numbers would also have to be attached to attributes. Alternatively, moving the check to the parser wouldn't work in general, because the use of ltail or lhead in an edge may precede the definition of the cluster.
As for providing stricter checking, this could be helpful. Other
possible checks would be for multiple edge expressions for the same
edge, and reporting attributes or values unrecognized by graphviz.
This last would probably be most helpful if it checked specifically
for attributes close to a known attribute or value, to pick up