cmp_list -> compare_chained ...

to better match the Python AST name Compare. Relates to Issue #29
This commit is contained in:
rocky
2017-11-24 06:58:07 -05:00
parent 340ac7407f
commit 85d65e25ba
8 changed files with 37 additions and 28 deletions

View File

@@ -10,8 +10,9 @@ from uncompyle6.parsers.parse3 import Python3Parser
class Python32Parser(Python3Parser):
def p_32to35(self, args):
"""
conditional ::= expr jmp_false expr jump_forward_else expr COME_FROM
cmp_list2 ::= expr COMPARE_OP RETURN_VALUE
conditional ::= expr jmp_false expr jump_forward_else expr COME_FROM
# used exclusively in compare_chained
compare_chained2 ::= expr COMPARE_OP RETURN_VALUE
# Store locals is only in Python 3.0 to 3.3
stmt ::= store_locals
@@ -57,7 +58,7 @@ class Python32Parser(Python3Parser):
def add_custom_rules(self, tokens, customize):
# self.remove_rules("""
# cmp_list2 ::= expr COMPARE_OP RETURN_VALUE
# compare_chained2 ::= expr COMPARE_OP RETURN_VALUE
# """)
super(Python32Parser, self).add_custom_rules(tokens, customize)
for i, token in enumerate(tokens):