You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Isolate listcomp rule in 2.7
This commit is contained in:
@@ -29,7 +29,7 @@ def test_grammar():
|
||||
expect_lhs.add('kv3')
|
||||
|
||||
unused_rhs = unused_rhs.union(set("""
|
||||
except_pop_except generator_exp classdefdeco2 listcomp
|
||||
except_pop_except generator_exp classdefdeco2
|
||||
mapexpr
|
||||
""".split()))
|
||||
if 3.0 <= PYTHON_VERSION:
|
||||
|
@@ -351,6 +351,11 @@ class Python2Parser(PythonParser):
|
||||
"LOAD_ASSERT expr CALL_FUNCTION_1 RAISE_VARARGS_1 COME_FROM",
|
||||
], customize)
|
||||
continue
|
||||
elif opname == 'LOAD_LISTCOMP':
|
||||
self.add_unique_rules([
|
||||
"expr ::= listcomp",
|
||||
], customize)
|
||||
continue
|
||||
elif opname == 'LOAD_SETCOMP':
|
||||
self.add_unique_rules([
|
||||
"expr ::= set_comp",
|
||||
|
@@ -260,7 +260,7 @@ class Scanner2(Scanner):
|
||||
customize[op_name] = 0
|
||||
elif op == self.opc.CONTINUE_LOOP:
|
||||
customize[op_name] = 0
|
||||
elif op_name == 'LOAD_SETCOMP':
|
||||
elif op_name in frozenset(('LOAD_LISTCOMP', 'LOAD_SETCOMP')):
|
||||
customize[op_name] = 0
|
||||
elif op == self.opc.JUMP_ABSOLUTE:
|
||||
# Further classify JUMP_ABSOLUTE into backward jumps
|
||||
|
Reference in New Issue
Block a user