mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
Check that it's a variable definition before collapsing or giving warning.
This commit is contained in:
parent
100de9c8e9
commit
64e5d0dc92
1 changed files with 7 additions and 6 deletions
|
@ -367,9 +367,10 @@ class optimizer(object):
|
|||
self.Fold(entry[2][event][2], False)
|
||||
elif type(entry[2]) == tuple:
|
||||
self.Fold(entry[2]) # global
|
||||
val = entry[2]
|
||||
# Unfold constant
|
||||
if val[0] == 'EXPR' and val[2][0] == CONSTANT:
|
||||
symtab[0][name] = entry[:2] + (val[2][2],) + entry[3:]
|
||||
else:
|
||||
warning(u'WARNING: Expression does not collapse to a single constant.')
|
||||
if len(entry) == 3:
|
||||
val = entry[2]
|
||||
# Unfold constant
|
||||
if val[0] == 'EXPR' and val[2][0] == CONSTANT:
|
||||
symtab[0][name] = entry[:2] + (val[2][2],) + entry[3:]
|
||||
else:
|
||||
warning(u'WARNING: Expression does not collapse to a single constant.')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue