From 59451b90e5891ba9f2fd0c9914bd3289ff9fcf8f Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Fri, 27 Feb 2015 20:12:17 +0100 Subject: [PATCH] On second thought, parentheses are only needed for ~ because it binds tighter. --- lslopt/lslfoldconst.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lslopt/lslfoldconst.py b/lslopt/lslfoldconst.py index b43e803..1f3a215 100644 --- a/lslopt/lslfoldconst.py +++ b/lslopt/lslfoldconst.py @@ -423,10 +423,11 @@ class foldconst(object): if RSEF: node['SEF'] = True else: # Add the NEG - node = {'nt':'()', 't':optype, 'ch':[rval]} - if RSEF: - node['SEF'] = True - node = {'nt':'NEG', 't':optype, 'ch':[node]} + #node = {'nt':'()', 't':optype, 'ch':[rval]} + #if RSEF: + # node['SEF'] = True + #node = {'nt':'NEG', 't':optype, 'ch':[node]} + node = {'nt':'NEG', 't':optype, 'ch':[rval]} if RSEF: node['SEF'] = True node = {'nt':'~', 't':optype, 'ch':[node]} @@ -444,10 +445,11 @@ class foldconst(object): if lval['value'] == 1 or lval['value'] == 2: if rnt == '~': # Cancel the ~ - node = {'nt':'()', 't':optype, 'ch':rval['ch']} - if RSEF: - node['SEF'] = True - node = {'nt':'NEG', 't':optype, 'ch':[node]} + #node = {'nt':'()', 't':optype, 'ch':rval['ch']} + #if RSEF: + # node['SEF'] = True + #node = {'nt':'NEG', 't':optype, 'ch':[node]} + node = {'nt':'NEG', 't':optype, 'ch':rval['ch']} if RSEF: node['SEF'] = True else: