You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
2.4 grammar reduction
This commit is contained in:
@@ -33,9 +33,6 @@ class Python24Parser(Python25Parser):
|
|||||||
importmultiple ::= filler LOAD_CONST import_as imports_cont
|
importmultiple ::= filler LOAD_CONST import_as imports_cont
|
||||||
import_cont ::= filler LOAD_CONST import_as
|
import_cont ::= filler LOAD_CONST import_as
|
||||||
|
|
||||||
import_as ::= IMPORT_NAME load_attrs designator
|
|
||||||
load_attrs ::= LOAD_ATTR+
|
|
||||||
|
|
||||||
# Python 2.5+ omits POP_TOP POP_BLOCK
|
# Python 2.5+ omits POP_TOP POP_BLOCK
|
||||||
while1stmt ::= SETUP_LOOP l_stmts JUMP_BACK POP_TOP POP_BLOCK COME_FROM
|
while1stmt ::= SETUP_LOOP l_stmts JUMP_BACK POP_TOP POP_BLOCK COME_FROM
|
||||||
while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_TOP POP_BLOCK COME_FROM
|
while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_TOP POP_BLOCK COME_FROM
|
||||||
@@ -58,6 +55,10 @@ class Python24Parser(Python25Parser):
|
|||||||
def add_custom_rules(self, tokens, customize):
|
def add_custom_rules(self, tokens, customize):
|
||||||
self.remove_rules("""
|
self.remove_rules("""
|
||||||
kvlist ::= kvlist kv3
|
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)
|
super(Python24Parser, self).add_custom_rules(tokens, customize)
|
||||||
if self.version == 2.4:
|
if self.version == 2.4:
|
||||||
|
Reference in New Issue
Block a user