mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-31 12:00:38 +00:00
opening paren and comma to the operator stack for function calls
This commit is contained in:
parent
b81b5d8c4d
commit
f03bffc3ee
1 changed files with 14 additions and 1 deletions
15
parser.c
15
parser.c
|
@ -451,7 +451,20 @@ static ast_expression* parser_expression(parser_t *parser)
|
|||
wantop = nextwant;
|
||||
parser->lex->flags.noops = !wantop;
|
||||
} else {
|
||||
if (parser->tok == ')') {
|
||||
if (parser->tok == '(') {
|
||||
/* we expected an operator, this is the function-call operator */
|
||||
if (!shunt_ops_add(&sy, syparen(parser_ctx(parser), 'f'))) {
|
||||
parseerror(parser, "out of memory");
|
||||
goto onerr;
|
||||
}
|
||||
}
|
||||
else if (parser->tok == ',') {
|
||||
if (!shunt_ops_add(&sy, syparen(parser_ctx(parser), ','))) {
|
||||
parseerror(parser, "out of memory");
|
||||
goto onerr;
|
||||
}
|
||||
}
|
||||
else if (parser->tok == ')') {
|
||||
/* we do expect an operator next */
|
||||
/* closing an opening paren */
|
||||
if (!sy.ops_count) {
|
||||
|
|
Loading…
Reference in a new issue