)
def generate_function_call(function_call):
- return '{}({}, {})'.format(
+ return 'Environment_get(environment, "{}").instance.closure({}, {})'.format(
function_call.name,
function_call.argument_count,
# TODO This is just a single item containing a reference to the items list--make that clearer
{
Environment* environment = Environment_construct();
+ // TODO Use the symbol from SYMBOL_LIST
+ {% for builtin in builtins %}
+ Environment_set(environment, "{{ builtin }}", builtin${{ builtin }});
+ {% endfor %}
+
{% for statement in statements %}
{{ statement }}
{% endfor %}
# TODO Check that the builtin is actually callable
accumulators.builtin_set.add(function_call.function.value)
+ # TODO Use the symbol from SYMBOL LIST
return CFunctionCallExpression(
- name='builtin${}.instance.closure'.format(function_call.function.value),
+ name=function_call.function.value,
argument_count=function_call.argument_count,
argument_items=transform_expression(accumulators, function_call.argument_items),
)