Bug in parsing of quoted strings

9 views
Skip to first unread message

Kjell Magne Fauske

unread,
Apr 17, 2008, 5:33:12 AM4/17/08
to pydot
Hello pydot users,

I just stumbled upon a bug in how Pyparsing (and pydot) parses quoted
string. Example:

digraph G {
a [label="\n\nA \"quote\""];
a -> b;
}

Pydot does not parse the above graph correctly. A fix is to replace
the code:

double_quoted_string = QuotedString('"', multiline=True,
unquoteResults=False)

with

double_quoted_string = Regex(r'\"(?:\\\"|[^"])*\"', re.MULTILINE)

The most obvious solution

double_quoted_string = QuotedString('"', multiline=True,
unquoteResults=False,escChar='\\')

does not work due to a bug in Pyparsing. See
http://pyparsing.wikispaces.com/message/view/home/3778969 for
details.

Regards,
Kjell Magne Fauske
Reply all
Reply to author
Forward
0 new messages