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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user