mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-24 04:41:25 +00:00
add 'X has been declared here:' too the too-few/many-parameters warning/error
This commit is contained in:
parent
8adbf07555
commit
dff6328c9e
1 changed files with 16 additions and 8 deletions
24
parser.c
24
parser.c
|
@ -1000,23 +1000,31 @@ static bool parser_close_call(parser_t *parser, shunt *sy)
|
||||||
if (opts_standard == COMPILER_GMQCC)
|
if (opts_standard == COMPILER_GMQCC)
|
||||||
{
|
{
|
||||||
if (fval)
|
if (fval)
|
||||||
parseerror(parser, "too %s parameters for call to %s: expected %i, got %i", fewmany,
|
parseerror(parser, "too %s parameters for call to %s: expected %i, got %i\n"
|
||||||
fval->name, (int)fun->expression.params_count, paramcount);
|
" -> `%s` has been declared here: %s:%i",
|
||||||
|
fewmany, fval->name, (int)fun->expression.params_count, (int)paramcount,
|
||||||
|
fval->name, ast_ctx(fun).file, (int)ast_ctx(fun).line);
|
||||||
else
|
else
|
||||||
parseerror(parser, "too %s parameters for function call: expected %i, got %i", fewmany,
|
parseerror(parser, "too %s parameters for function call: expected %i, got %i\n"
|
||||||
(int)fun->expression.params_count, paramcount);
|
" -> `%s` has been declared here: %s:%i",
|
||||||
|
fewmany, fval->name, (int)fun->expression.params_count, (int)paramcount,
|
||||||
|
fval->name, ast_ctx(fun).file, (int)ast_ctx(fun).line);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (fval)
|
if (fval)
|
||||||
return !parsewarning(parser, WARN_TOO_FEW_PARAMETERS,
|
return !parsewarning(parser, WARN_TOO_FEW_PARAMETERS,
|
||||||
"too %s parameters for call to %s: expected %i, got %i", fewmany,
|
"too %s parameters for call to %s: expected %i, got %i\n"
|
||||||
fval->name, (int)fun->expression.params_count, paramcount);
|
" -> `%s` has been declared here: %s:%i",
|
||||||
|
fewmany, fval->name, (int)fun->expression.params_count, (int)paramcount,
|
||||||
|
fval->name, ast_ctx(fun).file, (int)ast_ctx(fun).line);
|
||||||
else
|
else
|
||||||
return !parsewarning(parser, WARN_TOO_FEW_PARAMETERS,
|
return !parsewarning(parser, WARN_TOO_FEW_PARAMETERS,
|
||||||
"too %s parameters for function call: expected %i, got %i", fewmany,
|
"too %s parameters for function call: expected %i, got %i\n"
|
||||||
(int)fun->expression.params_count, paramcount);
|
" -> `%s` has been declared here: %s:%i",
|
||||||
|
fewmany, fval->name, (int)fun->expression.params_count, (int)paramcount,
|
||||||
|
fval->name, ast_ctx(fun).file, (int)ast_ctx(fun).line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue