summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-01-17 19:20:24 -0800
committerOri Bernstein <ori@eigenstate.org>2015-01-17 19:20:24 -0800
commit9aba330f84be289a9671a0b4614ca0dc62b82fa8 (patch)
treecabd6d4696c1e617c000d5dd76c9296376b27556 /parse
parent86480cd260f395a64424ab091bd910020c6e7137 (diff)
downloadmc-9aba330f84be289a9671a0b4614ca0dc62b82fa8.tar.gz
Change biding of union constructors and casts.
Diffstat (limited to 'parse')
-rw-r--r--parse/gram.y15
1 files changed, 7 insertions, 8 deletions
diff --git a/parse/gram.y b/parse/gram.y
index 858d722..6b0ca62 100644
--- a/parse/gram.y
+++ b/parse/gram.y
@@ -602,22 +602,21 @@ landexpr: landexpr Tland cmpexpr
cmpexpr : cmpexpr cmpop castexpr
{$$ = mkexpr($1->loc, binop($2->type), $1, $3, NULL);}
- | castexpr
+ | unionexpr
;
-
cmpop : Teq | Tgt | Tlt | Tge | Tle | Tne ;
+unionexpr
+ : Ttick name unionexpr {$$ = mkexpr($1->loc, Oucon, $2, $3, NULL);}
+ | Ttick name {$$ = mkexpr($1->loc, Oucon, $2, NULL);}
+ | castexpr
+ ;
+
castexpr: castexpr Tcast Toparen type Tcparen {
$$ = mkexpr($1->loc, Ocast, $1, NULL);
$$->expr.type = $4;
}
- | unionexpr
- ;
-
-unionexpr
- : Ttick name unionexpr {$$ = mkexpr($1->loc, Oucon, $2, $3, NULL);}
- | Ttick name {$$ = mkexpr($1->loc, Oucon, $2, NULL);}
| borexpr
;