remove debug
This commit is contained in:
parent
576fdb18d6
commit
0fe6371043
1 changed files with 20 additions and 21 deletions
|
|
@ -134,28 +134,27 @@ class ScriptUtils:
|
|||
return None
|
||||
|
||||
output = ""
|
||||
try:
|
||||
for sub_arg in arg.args:
|
||||
if isinstance(sub_arg, Variable):
|
||||
# No need to sanitize built-in integer variables
|
||||
if isinstance(VARIABLES.get(sub_arg.name), (IntegerVariable, BooleanVariable)):
|
||||
output += f"{{ {sub_arg.name} }}"
|
||||
else:
|
||||
output += f"{{ {sub_arg.name}_sanitized }}"
|
||||
elif isinstance(sub_arg, (Integer, Float, Boolean)):
|
||||
output += str(sub_arg.native)
|
||||
elif isinstance(sub_arg, String):
|
||||
output += CustomFunctions.sanitize(sub_arg).native
|
||||
elif isinstance(sub_arg, BuiltInFunction) and (
|
||||
sub_arg.function_spec.has_sanitized_output() or sub_arg.name == "pad_zero"
|
||||
):
|
||||
# If we know the function's output is sanitized, let's not wrap it
|
||||
output += cls._to_script_code(sub_arg, top_level=True)
|
||||
for sub_arg in arg.args:
|
||||
if isinstance(sub_arg, Variable):
|
||||
# No need to sanitize built-in integer variables
|
||||
if isinstance(VARIABLES.get(sub_arg.name), (IntegerVariable, BooleanVariable)):
|
||||
output += f"{{ {sub_arg.name} }}"
|
||||
else:
|
||||
# Purposefully do not set top_level to True so we do not recurse
|
||||
output += f"{{ {cls._to_script_code(BuiltInFunction(name='sanitize', args=[sub_arg]))} }}"
|
||||
except TypeError:
|
||||
print("huh")
|
||||
output += f"{{ {sub_arg.name}_sanitized }}"
|
||||
elif isinstance(sub_arg, (Integer, Float, Boolean)):
|
||||
output += str(sub_arg.native)
|
||||
elif isinstance(sub_arg, String):
|
||||
output += CustomFunctions.sanitize(sub_arg).native
|
||||
elif isinstance(sub_arg, BuiltInFunction) and (
|
||||
sub_arg.function_spec.has_sanitized_output() or sub_arg.name == "pad_zero"
|
||||
):
|
||||
# If we know the function's output is sanitized, let's not wrap it
|
||||
output += cls._to_script_code(sub_arg, top_level=True)
|
||||
else:
|
||||
# Purposefully do not set top_level to True so we do not recurse
|
||||
output += (
|
||||
f"{{ {cls._to_script_code(BuiltInFunction(name='sanitize', args=[sub_arg]))} }}"
|
||||
)
|
||||
|
||||
return output
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue