X-Git-Url: https://code.kerkeslager.com/?p=fur;a=blobdiff_plain;f=transformation.py;h=83fc36bfa2294cdbf41dabe88587df937d336bbc;hp=0eed799e1f7b46cbabc66fee1677b0c2d75493e2;hb=74c7456042282dd86f9be673cbd1e00496b28710;hpb=b059a00e0e2511a2ca2477db1e91d53fc5d2ec0f diff --git a/transformation.py b/transformation.py index 0eed799..83fc36b 100644 --- a/transformation.py +++ b/transformation.py @@ -292,13 +292,15 @@ def transform_symbol_assignment_statement(accumulators, assignment_statement): ) def transform_function_call_expression(accumulators, function_call): - if function_call.function.value in BUILTINS.keys(): - # TODO Check that the builtin is actually callable - accumulators.builtin_set.add(function_call.function.value) + if isinstance(function_call.function, parsing.FurSymbolExpression): + # TODO Move this check to transformation of symbol expressions so we can have builtins that aren't functions + if function_call.function.value in BUILTINS.keys(): + # 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=function_call.function.value, + name=transform_expression(accumulators, function_call.function), argument_count=function_call.argument_count, argument_items=transform_expression(accumulators, function_call.argument_items), )