]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
opening paren and comma to the operator stack for function calls
authorWolfgang Bumiller <wolfgang.linux@bumiller.com>
Fri, 27 Jul 2012 10:35:14 +0000 (12:35 +0200)
committerWolfgang Bumiller <wolfgang.linux@bumiller.com>
Fri, 27 Jul 2012 10:35:14 +0000 (12:35 +0200)
parser.c

index ddb81d1ef6adcd6ff36b40d752e3fbe4de783e75..56f20f271957c73d056dd173a57bfc727d4d2039 100644 (file)
--- 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) {