Skip to content

Commit

Permalink
extern function: Actually looks like it all works
Browse files Browse the repository at this point in the history
  • Loading branch information
obiwac committed Sep 10, 2024
1 parent 7209dd1 commit fbd2774
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions flamingo/grammar/call.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,11 @@ static int parse_call(flamingo_t* flamingo, TSNode node, flamingo_val_t** val) {
return error(flamingo, "cannot call external function without a external function callback being set");
}

flamingo->external_fn_cb(flamingo, callable->name_size, callable->name, flamingo->external_fn_cb_data);
// TODO Arguments, return value.

// TODO Rest.
if (flamingo->external_fn_cb(flamingo, callable->name_size, callable->name, flamingo->external_fn_cb_data) < 0) {
return -1;
}
}

else if (parse_block(flamingo, *body, is_class ? &inner_scope : NULL) < 0) {
Expand Down

0 comments on commit fbd2774

Please sign in to comment.