[Pyparsing] recursion in _flatten after version 1.5.2
Brought to you by:
ptmcg
From: Luke C. <lca...@em...> - 2011-05-30 15:28:17
|
Howdy, I have a script that I use to strip comments from C files. The code fails for any pyparsing version later than 1.5.2. Backtrace looks like this: File "CParser.py", line 300, in removeComments self.files[file] = (quotedString | cStyleComment.suppress() | cplusplusLineComment.suppress()).transformString(text) File "c:\python27\lib\site-packages\pyparsing.py", line 1166, in transformString return "".join(map(_ustr,_flatten(out))) File "c:\python27\lib\site-packages\pyparsing.py", line 3190, in _flatten return _flatten(L[0]) + _flatten(L[1:]) File "c:\python27\lib\site-packages\pyparsing.py", line 3190, in _flatten return _flatten(L[0]) + _flatten(L[1:]) . . . File "c:\python27\lib\site-packages\pyparsing.py", line 3188, in _flatten if type(L) is not list: return [L] RuntimeError: maximum recursion depth exceeded while calling a Python object If I remember correctly, 'quotedString' and cStyleComment' are provided by pyparsing, and I have provided this definition: cplusplusLineComment = Literal("//") + restOfLine Any hints? Luke |