]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
move the member-of check for '.' to after applying the previous dot operators so...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 18 Aug 2012 17:42:38 +0000 (19:42 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 18 Aug 2012 17:42:38 +0000 (19:42 +0200)
data/functions.qc
parser.c

index 241be833e9fb46f2aebd9b4ff15a65fb1d702bda..7e479c173d9d64cc8bcad992b76ed2e5fc608728 100644 (file)
@@ -22,7 +22,7 @@ void() main = {
     pawn2 = spawn();
 
     pawn.other = pawn2;
-    (pawn.other).vis = 0;
+    pawn.other.vis = 0;
 
     if (!visible(pawn.other))
         print("Yes\n");
index 5fb87651e80abf25221cbe9a7225cb569e7410e6..3608171b31855f8e4dee2aaf4283f3ade7b45a39 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1167,6 +1167,21 @@ static ast_expression* parser_expression_leave(parser_t *parser, bool stopatcomm
             if (op->id == opid1(',') && !parens && stopatcomma)
                 break;
 
+            if (sy.ops_count && !sy.ops[sy.ops_count-1].paren)
+                olast = &operators[sy.ops[sy.ops_count-1].etype-1];
+
+            while (olast && (
+                    (op->prec < olast->prec) ||
+                    (op->assoc == ASSOC_LEFT && op->prec <= olast->prec) ) )
+            {
+                if (!parser_sy_pop(parser, &sy))
+                    goto onerr;
+                if (sy.ops_count && !sy.ops[sy.ops_count-1].paren)
+                    olast = &operators[sy.ops[sy.ops_count-1].etype-1];
+                else
+                    olast = NULL;
+            }
+
             if (op->id == opid1('.')) {
                 /* for gmqcc standard: open up the namespace of the previous type */
                 ast_expression *prevex = sy.out[sy.out_count-1].out;
@@ -1185,21 +1200,6 @@ static ast_expression* parser_expression_leave(parser_t *parser, bool stopatcomm
                 gotmemberof = true;
             }
 
-            if (sy.ops_count && !sy.ops[sy.ops_count-1].paren)
-                olast = &operators[sy.ops[sy.ops_count-1].etype-1];
-
-            while (olast && (
-                    (op->prec < olast->prec) ||
-                    (op->assoc == ASSOC_LEFT && op->prec <= olast->prec) ) )
-            {
-                if (!parser_sy_pop(parser, &sy))
-                    goto onerr;
-                if (sy.ops_count && !sy.ops[sy.ops_count-1].paren)
-                    olast = &operators[sy.ops[sy.ops_count-1].etype-1];
-                else
-                    olast = NULL;
-            }
-
             if (op->id == opid1('(')) {
                 if (wantop) {
                     DEBUGSHUNTDO(printf("push (\n"));