Fix bug where assignments were treated as statements.

This caused e.g. b = a = a to raise an exception, when a = a was folded into a ';' which isn't an expression.
This commit is contained in:
Sei Lisa 2017-09-22 16:04:44 +02:00
parent a0d4c77081
commit bdd42199eb

View file

@ -1060,8 +1060,7 @@ class foldconst(object):
and child[1]['ch'][0]['name'] == child[0]['ch'][0]['name'] \ and child[1]['ch'][0]['name'] == child[0]['ch'][0]['name'] \
and child[1]['ch'][0]['scope'] == child[0]['ch'][0]['scope'] \ and child[1]['ch'][0]['scope'] == child[0]['ch'][0]['scope'] \
and child[1]['fld'] == child[0]['fld']: and child[1]['fld'] == child[0]['fld']:
node['SEF'] = True parent[index] = child[1]
self.FoldStmt(parent, index)
return return
if nt == 'IDENT' or nt == 'FLD': if nt == 'IDENT' or nt == 'FLD':