Isolate "and2" rule to 2.3

This commit is contained in:
rocky
2017-11-16 10:47:35 -05:00
parent 53beae8ee6
commit e26de53332
2 changed files with 5 additions and 5 deletions

View File

@@ -465,7 +465,6 @@ class PythonParser(GenericASTBuilder):
expr ::= cmp
expr ::= mapexpr
expr ::= and
expr ::= and2
expr ::= or
expr ::= unary_expr
expr ::= call_function
@@ -510,10 +509,6 @@ class PythonParser(GenericASTBuilder):
_mklambda ::= load_closure mklambda
_mklambda ::= mklambda
# "and" where the first part of the and is true,
# so there is only the 2nd part to evaluate
and2 ::= _jump jmp_false COME_FROM expr COME_FROM
expr ::= conditional
conditional ::= expr jmp_false expr JUMP_FORWARD expr COME_FROM
conditional ::= expr jmp_false expr JUMP_ABSOLUTE expr

View File

@@ -42,6 +42,11 @@ class Python23Parser(Python24Parser):
lc_body ::= LOAD_FAST expr CALL_FUNCTION_1 POP_TOP
lc_body ::= LOAD_NAME expr LIST_APPEND
lc_body ::= LOAD_FAST expr LIST_APPEND
# "and" where the first part of the and is true,
# so there is only the 2nd part to evaluate
expr ::= and2
and2 ::= _jump jmp_false COME_FROM expr COME_FROM
'''
def add_custom_rules(self, tokens, customize):