mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +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)
|
self.Fold(entry[2][event][2], False)
|
||||||
elif type(entry[2]) == tuple:
|
elif type(entry[2]) == tuple:
|
||||||
self.Fold(entry[2]) # global
|
self.Fold(entry[2]) # global
|
||||||
val = entry[2]
|
if len(entry) == 3:
|
||||||
# Unfold constant
|
val = entry[2]
|
||||||
if val[0] == 'EXPR' and val[2][0] == CONSTANT:
|
# Unfold constant
|
||||||
symtab[0][name] = entry[:2] + (val[2][2],) + entry[3:]
|
if val[0] == 'EXPR' and val[2][0] == CONSTANT:
|
||||||
else:
|
symtab[0][name] = entry[:2] + (val[2][2],) + entry[3:]
|
||||||
warning(u'WARNING: Expression does not collapse to a single constant.')
|
else:
|
||||||
|
warning(u'WARNING: Expression does not collapse to a single constant.')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue