From: Wolfgang Bumiller Date: Fri, 27 Jul 2012 10:35:14 +0000 (+0200) Subject: opening paren and comma to the operator stack for function calls X-Git-Tag: 0.1-rc1~388 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f03bffc3ee345162c045329bd95d85cbdbe8d8fe;p=xonotic%2Fgmqcc.git opening paren and comma to the operator stack for function calls --- diff --git a/parser.c b/parser.c index ddb81d1..56f20f2 100644 --- a/parser.c +++ b/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) {