From: Wolfgang Bumiller Date: Sat, 12 Jan 2013 13:59:30 +0000 (+0100) Subject: Creating the argument counter if requested X-Git-Tag: before-library~285 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=57c0a0980089272a064273f99ad1a4bc87ac8ea2;p=xonotic%2Fgmqcc.git Creating the argument counter if requested --- 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);