Fix import and 3.x class bugs...

import x.y as z was failing across all Python versions
class decorators for Python 3.0..3.3 was failing
reduce 3.x while grammar rules
This commit is contained in:
rocky
2017-11-29 06:59:05 -05:00
parent 42fd38e2c0
commit f2eaa09e96
19 changed files with 6 additions and 12 deletions

View File

@@ -18,9 +18,6 @@ class Python33Parser(Python32Parser):
# We do the grammar hackery below for semantics
# actions that want c_stmts_opt at index 1
whileTruestmt ::= SETUP_LOOP l_stmts JUMP_ABSOLUTE
JUMP_BACK COME_FROM_LOOP
# Python 3.5+ has jump optimization to remove the redundant
# jump_excepts. But in 3.3 we need them added
@@ -33,11 +30,8 @@ class Python33Parser(Python32Parser):
def add_custom_rules(self, tokens, customize):
self.remove_rules("""
# 3.3+ adds POP_BLOCKS
whileTruestmt ::= SETUP_LOOP l_stmts JUMP_ABSOLUTE JUMP_BACK 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
whilestmt ::= SETUP_LOOP testexpr l_stmts_opt JUMP_BACK
POP_BLOCK JUMP_ABSOLUTE COME_FROM_LOOP
""")
super(Python33Parser, self).add_custom_rules(tokens, customize)
return