Base 2.5 off of 2.6. Some other small bugs.

This commit is contained in:
rocky
2016-06-27 22:55:59 -04:00
parent 21216b4eb1
commit ae980e4f64
7 changed files with 35 additions and 355 deletions

View File

@@ -107,6 +107,10 @@ class Python26Parser(Python2Parser):
ret_cond ::= expr jmp_false expr RETURN_END_IF come_from_pop ret_expr_or_cond
ret_cond ::= expr jmp_false expr ret_expr_or_cond
ret_cond_not ::= expr jmp_true expr RETURN_END_IF come_from_pop ret_expr_or_cond
# FIXME: split into Python 2.5
ret_cond ::= expr jmp_false expr JUMP_RETURN come_from_pop ret_expr_or_cond
ret_or ::= expr jmp_true ret_expr_or_cond come_froms
'''
def p_except26(self, args):
@@ -114,6 +118,12 @@ class Python26Parser(Python2Parser):
except_suite ::= c_stmts_opt jmp_abs new_block
'''
def p_jump26(self, args):
"""
jmp_false ::= JUMP_IF_FALSE
jmp_true ::= JUMP_IF_TRUE
"""
class Python26ParserSingle(Python2Parser, PythonParserSingle):
pass