You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
whileTrue grammar reduction
This commit is contained in:
@@ -24,7 +24,6 @@ class Python32Parser(Python3Parser):
|
|||||||
|
|
||||||
# Python < 3.5 no POP BLOCK
|
# Python < 3.5 no POP BLOCK
|
||||||
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK COME_FROM_LOOP
|
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK COME_FROM_LOOP
|
||||||
whileTruestmt ::= SETUP_LOOP return_stmts COME_FROM_LOOP
|
|
||||||
|
|
||||||
# Python 3.5+ has jump optimization to remove the redundant
|
# Python 3.5+ has jump optimization to remove the redundant
|
||||||
# jump_excepts. But in 3.3 we need them added
|
# jump_excepts. But in 3.3 we need them added
|
||||||
|
@@ -140,9 +140,6 @@ class Python35Parser(Python34Parser):
|
|||||||
withasstmt ::= expr SETUP_WITH store suite_stmts_opt
|
withasstmt ::= expr SETUP_WITH store suite_stmts_opt
|
||||||
POP_BLOCK LOAD_CONST COME_FROM_WITH
|
POP_BLOCK LOAD_CONST COME_FROM_WITH
|
||||||
WITH_CLEANUP END_FINALLY
|
WITH_CLEANUP END_FINALLY
|
||||||
|
|
||||||
# FIXME: should this be in 3.3?
|
|
||||||
whileTruestmt ::= SETUP_LOOP return_stmts COME_FROM_LOOP
|
|
||||||
""")
|
""")
|
||||||
super(Python35Parser, self).add_custom_rules(tokens, customize)
|
super(Python35Parser, self).add_custom_rules(tokens, customize)
|
||||||
for i, token in enumerate(tokens):
|
for i, token in enumerate(tokens):
|
||||||
|
Reference in New Issue
Block a user