You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "Translator.py", line 379, in
lexer = lex(outputText)
File "Translator.py", line 105, in lex
lexer = lex.lex(reflags=re.VERBOSE, module=LexerPassThrough)
File "ply/lex.py", line 920, in lex
IndexError: list index out of range
Below is a suggested possible patch.
*** lex.py.old Wed Dec 21 10:44:55 2011
--- lex.py Wed Dec 21 10:45:28 2011
***************
*** 917,923 ****
# Get literals specification
if isinstance(linfo.literals,(list,tuple)):
! lexobj.lexliterals = type(linfo.literals[0])().join(linfo.literals)
else:
lexobj.lexliterals = linfo.literals
--- 917,926 ----
# Get literals specification
if isinstance(linfo.literals,(list,tuple)):
! if linfo.literals:
! lexobj.lexliterals = type(linfo.literals[0])().join(linfo.literals)
! else:
! lexobj.lexliterals = ""
else:
lexobj.lexliterals = linfo.literals
I could also see calling iter(linfo.literals) , which would be more Pythonic than an explicit check for list/tuple, but that's maybe going too far.
The text was updated successfully, but these errors were encountered:
If i set:
literals = []
I get:
Traceback (most recent call last):
File "Translator.py", line 379, in
lexer = lex(outputText)
File "Translator.py", line 105, in lex
lexer = lex.lex(reflags=re.VERBOSE, module=LexerPassThrough)
File "ply/lex.py", line 920, in lex
IndexError: list index out of range
Below is a suggested possible patch.
I could also see calling
iter(linfo.literals)
, which would be more Pythonic than an explicit check for list/tuple, but that's maybe going too far.The text was updated successfully, but these errors were encountered: