ref: e6758735f0b37beebb6b0a526680acf00f14bdd5
parent: ebda3c4f4770416661b320bf27b470f644bf75b0
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Jan 17 14:20:24 EST 2015
Change biding of union constructors and casts.
--- a/parse/gram.y
+++ b/parse/gram.y
@@ -602,22 +602,21 @@
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
;