Python 2.6 a == b or c == d == 3 grammar bug

This commit is contained in:
rocky
2017-02-28 09:18:36 -05:00
parent 65913778a5
commit e1111e3f50
3 changed files with 7 additions and 2 deletions

View File

@@ -38,6 +38,12 @@ class PythonParser(GenericASTBuilder):
# PyPy:
'kvlist_n'])
def ast_first_offset(self, ast):
if hasattr(ast, 'offset'):
return ast.offset
else:
return self.ast_first_offset(ast[0])
def add_unique_rule(self, rule, opname, count, customize):
"""Add rule to grammar, but only if it hasn't been added previously
opname and count are used in the customize() semantic the actions