Creating the argument counter if requested

This commit is contained in:
Wolfgang Bumiller 2013-01-12 14:59:30 +01:00
parent 175623592b
commit 57c0a09800

View file

@ -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);