Fixed function calls on builtin.
Random pointer indirection.
This commit is contained in:
parent
79b60e4853
commit
109bcb3fa5
@ -66,12 +66,14 @@ AST* exec_call(AST* ast) {
|
|||||||
AST* fdef = exec_find(fname);
|
AST* fdef = exec_find(fname);
|
||||||
|
|
||||||
if (fdef == NULL)
|
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) {
|
switch (fdef->type) {
|
||||||
case AST_TYPE_BIF:
|
case AST_TYPE_BIF:
|
||||||
ASTBIFData* bifdata = fdef->data;
|
ASTBIFData bifdata = fdef->data;
|
||||||
return (*bifdata)(argc, argv);
|
return bifdata(argc, argv);
|
||||||
default: return ast_init(AST_TYPE_EXC, ast_exc_data_init("Good job"));
|
default: return ast_init(AST_TYPE_EXC, ast_exc_data_init("Good job"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user