ast_expression *funcexpr)
{
ast_instantiate(ast_call, ctx, ast_call_delete);
+ if (!funcexpr->expression.next) {
+ compile_error(ctx, "not a function");
+ mem_d(self);
+ return NULL;
+ }
ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_call_codegen);
ast_side_effects(self) = true;
}
call = ast_call_new(sy->ops[vec_size(sy->ops)].ctx, fun);
- if (!call) {
- parseerror(parser, "internal error: failed to create ast_call node");
+ if (!call)
return false;
- }
if (fid+1 == vec_size(sy->out)) {
/* no arguments */