Predidence of cmp_list: x == y == z

The x, y, z should not have parenthesis around pairs of them
(x == y) or (y == z)
This commit is contained in:
rocky
2017-02-28 01:20:31 -05:00
parent 29122340e6
commit cf21fff38b
3 changed files with 11 additions and 1 deletions

Binary file not shown.

View File

@@ -0,0 +1,6 @@
# From Python 2.7 parse_starttag HTMLParser.pyc
attrvalue = [1,2]
while attrvalue:
if attrvalue[:1] == 5 or \
attrvalue[:1] == 2 == attrvalue[-1:]:
attrvalue = 10

View File

@@ -176,7 +176,7 @@ TABLE_DIRECT = {
'conditional_lambda': ( '(%c if %c else %c)', 2, 0, 3),
'return_lambda': ('%c', 0),
'compare': ( '%p %[-1]{pattr} %p', (0, 19), (1, 19) ),
'cmp_list': ( '%p %p', (0, 20), (1, 19)),
'cmp_list': ( '%p %p', (0, 29), (1, 30)),
'cmp_list1': ( '%[3]{pattr} %p %p', (0, 19), (-2, 19)),
'cmp_list2': ( '%[1]{pattr} %p', (0, 19)),
# 'classdef': (), # handled by n_classdef()
@@ -274,6 +274,10 @@ MAP = {
'exprlist': MAP_R0,
}
# Operator precidence
# See https://docs.python.org/3/reference/expressions.html
# or https://docs.python.org/3/reference/expressions.html
# for a list.
PRECEDENCE = {
'build_list': 0,
'mapexpr': 0,