From fbd277472b7b9c6d5c2f4ae7f8615cdfb015ad90 Mon Sep 17 00:00:00 2001 From: Aymeric Wibo Date: Tue, 10 Sep 2024 17:40:29 +0200 Subject: [PATCH] extern function: Actually looks like it all works --- flamingo/grammar/call.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flamingo/grammar/call.h b/flamingo/grammar/call.h index 58ad06c..7496f76 100644 --- a/flamingo/grammar/call.h +++ b/flamingo/grammar/call.h @@ -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) {