FurFunctionCallExpression = collections.namedtuple(
'FurFunctionCallExpression',
[
- 'name',
+ 'function',
'arguments',
],
)
# TODO Use a FurSymbolExpression for the name
failure = (False, index, None)
- if tokens[index].type != 'symbol':
+ success, index, function = _symbol_expression_parser(index, tokens)
+
+ if not success:
return failure
- name = tokens[index].match
- index += 1
if tokens[index].type != 'open_parenthese':
return failure
))
index += 1
- return True, index, FurFunctionCallExpression(name=name, arguments=arguments)
+ return True, index, FurFunctionCallExpression(function=function, arguments=arguments)
_expression_parser = _multiplication_level_expression_parser
return CNegationExpression(value=transform_expression(builtin_dependencies, negation_expression.value))
def transform_function_call_expression(builtin_dependencies, function_call):
- if function_call.name in BUILTINS.keys():
- builtin_dependencies.add(function_call.name)
+ if function_call.function.value in BUILTINS.keys():
+ builtin_dependencies.add(function_call.function.value)
return CFunctionCallExpression(
- name='builtin$' + function_call.name,
+ name='builtin$' + function_call.function.value,
arguments=tuple(transform_expression(builtin_dependencies, arg) for arg in function_call.arguments),
)