You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
More test coverage; simplify 3.2 grammar
This commit is contained in:
BIN
test/bytecode_3.2/01_ops.pyc
Normal file
BIN
test/bytecode_3.2/01_ops.pyc
Normal file
Binary file not shown.
@@ -67,9 +67,16 @@ class Python32Parser(Python3Parser):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def add_custom_rules(self, tokens, customize):
|
def add_custom_rules(self, tokens, customize):
|
||||||
# self.remove_rules("""
|
self.remove_rules("""
|
||||||
# compare_chained2 ::= expr COMPARE_OP RETURN_VALUE
|
try_middle ::= JUMP_FORWARD COME_FROM except_stmts END_FINALLY COME_FROM
|
||||||
# """)
|
try_middle ::= JUMP_FORWARD COME_FROM except_stmts END_FINALLY COME_FROM_EXCEPT
|
||||||
|
try_middle ::= JUMP_FORWARD COME_FROM_EXCEPT except_stmts END_FINALLY COME_FROM_EXCEPT_CLAUSE
|
||||||
|
try_middle ::= jmp_abs COME_FROM except_stmts END_FINALLY
|
||||||
|
tryelsestmt ::= SETUP_EXCEPT suite_stmts_opt POP_BLOCK try_middle else_suite come_from_except_clauses
|
||||||
|
while1elsestmt ::= SETUP_LOOP l_stmts JUMP_BACK else_suite COME_FROM_LOOP
|
||||||
|
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK NOP COME_FROM_LOOP
|
||||||
|
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_BLOCK NOP COME_FROM_LOOP
|
||||||
|
""")
|
||||||
super(Python32Parser, self).add_custom_rules(tokens, customize)
|
super(Python32Parser, self).add_custom_rules(tokens, customize)
|
||||||
for i, token in enumerate(tokens):
|
for i, token in enumerate(tokens):
|
||||||
opname = token.kind
|
opname = token.kind
|
||||||
|
Reference in New Issue
Block a user