Handle a wierd 2.6 conditional false expression...

from 2.6. test_grammar
This commit is contained in:
rocky
2017-12-03 19:54:26 -05:00
parent 0df29f344e
commit c791a45aae
7 changed files with 30 additions and 9 deletions

View File

@@ -84,9 +84,13 @@ class Python27Parser(Python2Parser):
compare_chained2 COME_FROM
compare_chained2 ::= expr COMPARE_OP RETURN_VALUE
expr ::= conditionalTrue
conditionalTrue ::= expr JUMP_FORWARD expr COME_FROM
conditional ::= expr jmp_false expr JUMP_FORWARD expr COME_FROM
# conditional_true are for conditions which always evaluate true
# There is dead or non-optional remnants of the condition code though,
# and we use that to match on to reconstruct the source more accurately
expr ::= conditional_true
conditional_true ::= expr JUMP_FORWARD expr COME_FROM
conditional ::= expr jmp_false expr JUMP_FORWARD expr COME_FROM
"""
def p_stmt27(self, args):