mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
Refine test for min and max.
We had dormant code to check for boolean-ness of functions, which is now active. But it didn't cover all possible booleans. Now it does. An idea for the future is to associate ranges to expressions, and attach them to calculable functions. For example, (integer)llFrand(2) could be resolved to a boolean.
This commit is contained in:
parent
ea9711642c
commit
923309e4a1
1 changed files with 1 additions and 1 deletions
|
@ -238,7 +238,7 @@ class foldconst(object):
|
|||
if nt == 'FNCALL':
|
||||
sym = self.symtab[0][node['name']]
|
||||
if sym['Type'] == 'integer' and 'min' in sym and 'max' in sym \
|
||||
and sym['min'] == 0 and sym['max'] == 1:
|
||||
and sym['min'] >= 0 and sym['max'] <= 1:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue