extend Python 2.6- lastc grammar-rule

Fixes #192
This commit is contained in:
rocky
2018-10-05 12:37:16 -04:00
parent bbdb238ddb
commit 7898fa157b
3 changed files with 16 additions and 1 deletions

Binary file not shown.

View File

@@ -0,0 +1,15 @@
# Bug was the join of two "for" loops at the end of an "if"
# this happens in Python 2.6 and before
def cheatCogdoMazeGame(self, base, kindOfCheat):
if base:
maze = kindOfCheat
if maze:
if kindOfCheat == 0:
for suitNum in maze.game.suitsById.keys():
maze.sendUpdate()
elif kindOfCheat == 1:
for joke in maze.game:
maze.sendUpdate()
else:
self.sendUpdate()

View File

@@ -155,7 +155,7 @@ class Python26Parser(Python2Parser):
iflaststmtl ::= testexpr c_stmts_opt jb_cf_pop
iflaststmt ::= testexpr c_stmts_opt JUMP_ABSOLUTE come_from_pop
lastc_stmt ::= iflaststmt COME_FROM
lastc_stmt ::= iflaststmt come_froms
ifstmt ::= testexpr_then _ifstmts_jump