-
Notifications
You must be signed in to change notification settings - Fork 163
dot_parser.py: Why does ID not have the float_number
production rule?
#436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
float_number
the float_number
production rule?float_number
production rule?
A lot of things in the identifier = Word(
pyparsing_unicode.BasicMultilingualPlane.alphanums + "_."
).setName("identifier") The addition of I suspect it was defined that way partly because port = (
Group(Group(colon + ID) + Group(colon + ID))
| Group(Group(colon + ID))
).setName("port")
node_id = ID + Optional(port) But you're correct that the parser definition excludes valid graphviz syntax, as a result. Both pydot and graphviz will accept this: graph G { 1.14 [color=red]; } but pydot will balk at this perfectly valid graph, which graphviz also accepts: graph G { -1.14 [color=red]; } ...The |
Actually, that's not true — the part immediately after the colon can be, the |
Part of the issue is that https://graphviz.org/pdf/dotguide.pdf#page=34 ... (We recently ripped out
Because, despite being documented in the grammar, |
Due to this issue pydot/pydot#436
Once I actually get it right (since it makes somewhat more sweeping changes to the parser definition, intended to shore up our support for unquoting quoted strings when possible — like graphviz itself does — among other things), this will also be fixed by #420. Also, @loonatick-src, if you're using a patched pydot (which it appears that you are), and assuming it's the version from loonatick-src/pydot@bb33fbe, I'd highly recommend also picking up commits 83c6b87 and aff9908 from my WIP #420 PR, or reimplementing them in your branch. Those two commits:
The IOW, when By instead using (I have another commit that does the same thing with the graph G {
some_node [color=, style=box];
rank=;
} |
Uh oh!
There was an error while loading. Please reload this page.
From the DOT language reference:
I see that that the second rule (numeral) is omitted from
ID
dot_parser.py and there is instead a righthand ID that satisfies the complete definition. Is there a particular reason for this?The text was updated successfully, but these errors were encountered: