You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Python 2.4 grammar reduction...
while increasing 2.4 increase test coverage
This commit is contained in:
BIN
test/bytecode_2.4/01_augmented_assign.pyc
Normal file
BIN
test/bytecode_2.4/01_augmented_assign.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_2.4/03_if1.pyc
Normal file
BIN
test/bytecode_2.4/03_if1.pyc
Normal file
Binary file not shown.
Binary file not shown.
@@ -49,16 +49,17 @@ class Python24Parser(Python25Parser):
|
||||
# Python 2.6, 2.7 and 3.3+ use kv3
|
||||
# Python 2.3- use kv
|
||||
kvlist ::= kvlist kv2
|
||||
kv2 ::= DUP_TOP expr expr ROT_THREE STORE_SUBSCR
|
||||
kv2 ::= DUP_TOP expr expr ROT_THREE STORE_SUBSCR
|
||||
'''
|
||||
|
||||
def add_custom_rules(self, tokens, customize):
|
||||
self.remove_rules("""
|
||||
kvlist ::= kvlist kv3
|
||||
while1stmt ::= SETUP_LOOP l_stmts JUMP_BACK COME_FROM
|
||||
while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK COME_FROM
|
||||
while1stmt ::= SETUP_LOOP return_stmts COME_FROM
|
||||
whilestmt ::= SETUP_LOOP testexpr return_stmts POP_BLOCK COME_FROM
|
||||
gen_comp_body ::= expr YIELD_VALUE POP_TOP
|
||||
kvlist ::= kvlist kv3
|
||||
while1stmt ::= SETUP_LOOP l_stmts JUMP_BACK COME_FROM
|
||||
while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK COME_FROM
|
||||
while1stmt ::= SETUP_LOOP return_stmts COME_FROM
|
||||
whilestmt ::= SETUP_LOOP testexpr return_stmts POP_BLOCK COME_FROM
|
||||
""")
|
||||
super(Python24Parser, self).add_custom_rules(tokens, customize)
|
||||
if self.version == 2.4:
|
||||
|
Reference in New Issue
Block a user