conditional -> if_exp ...

to match Python IfExp AST
This commit is contained in:
rocky
2020-02-07 16:17:47 -05:00
parent 7fb50918cd
commit 278af38df6
19 changed files with 98 additions and 103 deletions

View File

@@ -22,7 +22,7 @@ assert i[0]('a') == True
assert i[0]('A') == False
# Issue #170. Bug is needing an "conditional_not_lambda" grammar rule
# in addition the the "if_expr_lambda" rule
# in addition the the "if_exp_lambda" rule
j = lambda a: False if not a else True
assert j(True) == True
assert j(False) == False

View File

@@ -8,7 +8,7 @@ list(x for x in range(10) if x % 2 if x % 3)
# expresion which evaluates True unconditionally,
# but leave dead code or junk around that we have to match on.
# Tests "if_expr_true" rule
# Tests "if_exp_true" rule
5 if 1 else 2
0 or max(5, 3) if 0 else 3

View File

@@ -1,6 +1,6 @@
# Bug found in 2.7 test_itertools.py
# Bug was erroneously using reduction to if_expr_true
# A proper fix would be to use if_expr_true only when we
# Bug was erroneously using reduction to if_exp_true
# A proper fix would be to use if_exp_true only when we
# can determine there is or was dead code.
from itertools import izip_longest
for args in [['abc', range(6)]]: