PyParsing: Not all tokens passed to setParseAction()
- by Rosarch
I'm parsing sentences like "CS 2110 or INFO 3300". I would like to output a format like:
[[("CS" 2110)], [("INFO", 3300)]]
To do this, I thought I could use setParseAction(). However, the print statements in statementParse() suggest that only the last tokens are actually passed:
>>> statement.parseString("CS 2110 or INFO 3300")
Match…