Re: [Pyparsing] Slow parsing with indentedBlock()
Brought to you by:
ptmcg
From: Philipp R. <phi...@gm...> - 2009-11-20 20:46:51
|
Am Mon, 16 Nov 2009 18:06:31 +0100 schrieb spir: > Here is the tool. Try it first on various typical substrings of your > source. If works as expected, should be a major boost (and simplication > of your grammar as well). Thanks. I rewrote it to support variable-length indentation using an indent stack approach, as I apparently have quite a bit of data in formats such as this: 1 2 3 3 3 2 That seems to be just as stable and catches the indentation at level 0 thing as well. The grammar is more or less the same, replacing indentedBlock() instances with OPEN + OneOrMore + CLOSE instances, but parsing times are orders of magnitude better. Thanks, Philipp |