Robin -
If you are stepping through pyparsing code, I suggest you call
expr.streamline() (which collapses down structures like And([And([exprA,
exprB]), exprC]) to And([exprA, exprB, exprC]) ) before calling
expr.parseString().
You can also try using expr.runTests("test string to be parsed"), which
should give a clearer picture of how things are behaving. If you are using
parse actions, try decorating them with the pyparsing traceParseAction
decorator, which will show you the tokens going in and the return value
coming out.
-- Paul
-----Original Message-----
From: Robin Siebler <ml...@ds...>
Sent: Thursday, October 4, 2018 4:45 PM
To: pyp...@li...
Subject: [Pyparsing] Debugging
I have a class I created to parse output from a command-line tool with
variable output. It used to work, but the output of the tool has changed
and...I've gotten really rusty using PyParsing. Is there a good way to step
through my code and see what is going on while expressions are being
evaluated? I'm using PyCharm. I tried stepping through line-by-line but...I
don't really know what I'm looking for and I kept seeing a lot of code with
the word 'streamline' in it.
_______________________________________________
Pyparsing-users mailing list
Pyp...@li...
https://lists.sourceforge.net/lists/listinfo/pyparsing-users
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
|