From bdd42199eb15b3d1f049bd0023bb91fa47b25776 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Fri, 22 Sep 2017 16:04:44 +0200 Subject: [PATCH] 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. --- lslopt/lslfoldconst.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lslopt/lslfoldconst.py b/lslopt/lslfoldconst.py index 16fb156..c2eaf89 100644 --- a/lslopt/lslfoldconst.py +++ b/lslopt/lslfoldconst.py @@ -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':