From: Dale Weiler Date: Thu, 31 Jul 2014 16:37:26 +0000 (-0400) Subject: Fix T...name X-Git-Tag: xonotic-v0.8.1~9^2~26 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=823b053e6084cbb20cb8a55f0b3af073b4e3f2bd;p=xonotic%2Fgmqcc.git Fix T...name --- diff --git a/parser.c b/parser.c index f95a231..c45f68e 100644 --- a/parser.c +++ b/parser.c @@ -4675,10 +4675,6 @@ static ast_value *parse_parameter_list(parser_t *parser, ast_value *var) } } } else { - if (OPTS_OPTION_U32(OPTION_STANDARD) == COMPILER_FTEQCC && param->name[0] == '<') { - parseerror(parser, "parameter name omitted"); - goto on_error; - } vec_push(params, param); if (param->expression.vtype >= TYPE_VARIANT) { char tname[1024]; /* typename is reserved in C++ */ @@ -4697,12 +4693,17 @@ static ast_value *parse_parameter_list(parser_t *parser, ast_value *var) } if (parser->tok == TOKEN_IDENT) { argcounter = util_strdup(parser_tokval(parser)); + ast_value_set_name(param, argcounter); if (!parser_next(parser) || parser->tok != ')') { parseerror(parser, "`...` must be the last parameter of a variadic function declaration"); goto on_error; } } } + if (OPTS_OPTION_U32(OPTION_STANDARD) == COMPILER_FTEQCC && param->name[0] == '<') { + parseerror(parser, "parameter name omitted"); + goto on_error; + } } } diff --git a/tests/varargs.qc b/tests/varargs.qc index eceec4a..4b0d806 100644 --- a/tests/varargs.qc +++ b/tests/varargs.qc @@ -1,4 +1,4 @@ -void nbva(float a, ...count) { +void nbva(float a, string...count) { print("You gave me ", ftos(count), " additional parameters\n"); print("First: ", ...(0, string), "\n"); print("You chose: ", ...(a, string), "\n");