[Pyparsing] global setDebug feature
Brought to you by:
ptmcg
From: Mike S. <mik...@co...> - 2016-12-31 21:03:07
|
Sometimes it is annoying to try and figure out which elements need a setDebug() to figure out what went wrong. It would be nice to do: ParserElement.setDefaultDebug(True) ... ParserElement.setDefaultDebug(False) just like you can do: ParserElement.setDefaultWhitespaceChars() Then, I could just put this at the top before parser construction, and there isn't anything I would miss (or, at least, nothing in my source). Pre-built things would still not have debug set, like lineEnd for example; but that's ok. This more closely matches the feature of yacc/bison debugging, which will spray a ton of detail. Handy when just turn on all debugging, find and fix the issue, then turn it off. Easy to do with a one line change in a larger grammar. |