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:
@@ -1060,8 +1060,7 @@ class foldconst(object):
|
||||
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]['fld'] == child[0]['fld']:
|
||||
node['SEF'] = True
|
||||
self.FoldStmt(parent, index)
|
||||
parent[index] = child[1]
|
||||
return
|
||||
|
||||
if nt == 'IDENT' or nt == 'FLD':
|
||||
|
||||
Reference in New Issue
Block a user