mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-24 04:41:25 +00:00
Creating the argument counter if requested
This commit is contained in:
parent
175623592b
commit
57c0a09800
1 changed files with 6 additions and 0 deletions
6
parser.c
6
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);
|
||||
|
|
Loading…
Reference in a new issue