diff --git a/parser.c b/parser.c index 8c34de1..84c3e09 100644 --- a/parser.c +++ b/parser.c @@ -3998,6 +3998,12 @@ static bool parse_function_body(parser_t *parser, ast_value *var) } } + if (var->argcounter) { + ast_value *argc = ast_value_new(ast_ctx(var), var->argcounter, TYPE_FLOAT); + ast_block_collect(block, (ast_expression*)argc); + parser_addlocal(parser, argc->name, (ast_expression*)argc); + } + func = ast_function_new(ast_ctx(var), var->name, var); if (!func) { parseerror(parser, "failed to allocate function for `%s`", var->name);