Fixed function calls on builtin.

Random pointer indirection.
This commit is contained in:
Jacob Signorovitch 2025-02-25 07:56:25 -05:00
parent 79b60e4853
commit 109bcb3fa5

View File

@ -66,12 +66,14 @@ AST* exec_call(AST* ast) {
AST* fdef = exec_find(fname);
if (fdef == NULL)
return ast_init(AST_TYPE_EXC, ast_exc_data_init(strdup("No such function found.")));
return ast_init(
AST_TYPE_EXC, ast_exc_data_init(strdup("No such function found."))
);
switch (fdef->type) {
case AST_TYPE_BIF:
ASTBIFData* bifdata = fdef->data;
return (*bifdata)(argc, argv);
ASTBIFData bifdata = fdef->data;
return bifdata(argc, argv);
default: return ast_init(AST_TYPE_EXC, ast_exc_data_init("Good job"));
}
}