Fix comments that mentioned the wrong property.

This commit is contained in:
Sei Lisa 2015-02-27 19:18:28 +01:00
parent 07590ea850
commit 536b1ed2f9

View file

@ -280,12 +280,13 @@ class foldconst(object):
lval = child[0] = lval['ch'][0]
lnt = lval['nt']
# Addition of integers, strings, and lists is distributive
# Addition of integers, strings, and lists is associative
# Addition of floats, vectors and rotations would be, except
# for FP precision.
# TODO: distributive addition of lists
# Distributive lists are trickier, because unlike the others,
# the types of the operands may not be lists.
# TODO: associative addition of lists
# Associative lists are trickier, because unlike the others,
# the types of the operands may not be lists
# so e.g. list+(integer+integer) != (list+integer)+integer.
if optype in ('integer', 'string'):
if lnt == '+' and rnt == 'CONST' and lval['ch'][1]['nt'] == 'CONST':
# (var + ct1) + ct2 -> var + (ct1 + ct2)