From f03bffc3ee345162c045329bd95d85cbdbe8d8fe Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 27 Jul 2012 12:35:14 +0200 Subject: [PATCH] opening paren and comma to the operator stack for function calls --- parser.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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) { -- 2.39.2