mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-03 00:18:20 +00:00
On second thought, parentheses are only needed for ~ because it binds tighter.
This commit is contained in:
parent
25cbb91b6e
commit
59451b90e5
1 changed files with 10 additions and 8 deletions
|
@ -423,10 +423,11 @@ class foldconst(object):
|
||||||
if RSEF:
|
if RSEF:
|
||||||
node['SEF'] = True
|
node['SEF'] = True
|
||||||
else: # Add the NEG
|
else: # Add the NEG
|
||||||
node = {'nt':'()', 't':optype, 'ch':[rval]}
|
#node = {'nt':'()', 't':optype, 'ch':[rval]}
|
||||||
if RSEF:
|
#if RSEF:
|
||||||
node['SEF'] = True
|
# node['SEF'] = True
|
||||||
node = {'nt':'NEG', 't':optype, 'ch':[node]}
|
#node = {'nt':'NEG', 't':optype, 'ch':[node]}
|
||||||
|
node = {'nt':'NEG', 't':optype, 'ch':[rval]}
|
||||||
if RSEF:
|
if RSEF:
|
||||||
node['SEF'] = True
|
node['SEF'] = True
|
||||||
node = {'nt':'~', 't':optype, 'ch':[node]}
|
node = {'nt':'~', 't':optype, 'ch':[node]}
|
||||||
|
@ -444,10 +445,11 @@ class foldconst(object):
|
||||||
|
|
||||||
if lval['value'] == 1 or lval['value'] == 2:
|
if lval['value'] == 1 or lval['value'] == 2:
|
||||||
if rnt == '~': # Cancel the ~
|
if rnt == '~': # Cancel the ~
|
||||||
node = {'nt':'()', 't':optype, 'ch':rval['ch']}
|
#node = {'nt':'()', 't':optype, 'ch':rval['ch']}
|
||||||
if RSEF:
|
#if RSEF:
|
||||||
node['SEF'] = True
|
# node['SEF'] = True
|
||||||
node = {'nt':'NEG', 't':optype, 'ch':[node]}
|
#node = {'nt':'NEG', 't':optype, 'ch':[node]}
|
||||||
|
node = {'nt':'NEG', 't':optype, 'ch':rval['ch']}
|
||||||
if RSEF:
|
if RSEF:
|
||||||
node['SEF'] = True
|
node['SEF'] = True
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue