mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Fix bug in FoldStmt where EXPR nodes were not optimized out.
This commit is contained in:
parent
24a32c30e3
commit
bcc7fe3524
1 changed files with 4 additions and 1 deletions
|
@ -39,7 +39,10 @@ class optimizer(renamer, deadcode):
|
||||||
nothing.
|
nothing.
|
||||||
"""
|
"""
|
||||||
# Ideally this should consider side effect analysis of the whole thing.
|
# Ideally this should consider side effect analysis of the whole thing.
|
||||||
if parent[index]['nt'] in ('CONST', 'IDENT', 'FIELD'):
|
node = parent[index]
|
||||||
|
if node['nt'] == 'EXPR':
|
||||||
|
node = node['ch'][0]
|
||||||
|
if node['nt'] in ('CONST', 'IDENT', 'FLD'):
|
||||||
parent[index] = {'nt':';','t':None}
|
parent[index] = {'nt':';','t':None}
|
||||||
|
|
||||||
def FoldCond(self, parent, index):
|
def FoldCond(self, parent, index):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue