summaryrefslogtreecommitdiff
path: root/parse/gram.y
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-02-01 23:04:01 -0800
committerOri Bernstein <ori@eigenstate.org>2017-02-01 23:06:23 -0800
commitc307d63f28ceab7201fb9aeb770edfb7d91b5055 (patch)
tree8e87ef7b2a041b02c1b882deefdf46e649396cdf /parse/gram.y
parent0841450d6cd36d0799205a165b6f829e3fd7bb9e (diff)
downloadmc-c307d63f28ceab7201fb9aeb770edfb7d91b5055.tar.gz
Update the grammar.
Diffstat (limited to 'parse/gram.y')
-rw-r--r--parse/gram.y12
1 files changed, 5 insertions, 7 deletions
diff --git a/parse/gram.y b/parse/gram.y
index 9a1caa8..fac1f02 100644
--- a/parse/gram.y
+++ b/parse/gram.y
@@ -78,7 +78,6 @@ static void setupinit(Node *n);
%token<tok> Tcparen /* ) */
%token<tok> Tosqbrac /* [ */
%token<tok> Tcsqbrac /* ] */
-%token<tok> Tat /* @ */
%token<tok> Ttick /* ` */
%token<tok> Tderef /* # */
@@ -385,7 +384,7 @@ implbody
}
;
-traitdef: Ttrait Tident generictype optauxtypes { /* trait prototype */
+traitdef: Ttrait Tident generictype optauxtypes Tendln { /* trait prototype */
$$ = mktrait($1->loc,
mkname($2->loc, $2->id), $3,
$4.types, $4.ntypes,
@@ -498,7 +497,6 @@ compoundtype
| type Tosqbrac Tellipsis Tcsqbrac {$$ = mktyarray($2->loc, $1, NULL);}
| name Toparen typelist Tcparen {$$ = mktyunres($1->loc, $1, $3.types, $3.ntypes);}
| type Tderef {$$ = mktyptr($2->loc, $1);}
- | Tat Tident {$$ = mktyparam($1->loc, $2->id);}
| Tvoidlit {$$ = mktyunres($1->loc, mkname($1->loc, $1->id), NULL, 0);}
| name {$$ = mktyunres($1->loc, $1, NULL, 0);}
;
@@ -584,7 +582,7 @@ unionelt /* nb: the ucon union type gets filled in when we have context */
| Tendln {$$ = NULL;}
;
-goto : Tgoto Tident {
+goto : Tgoto Tident Tendln {
Node *lbl;
lbl = mklbl($2->loc, "");
@@ -901,11 +899,11 @@ stmt : goto
| /* empty */ {$$ = NULL;}
;
-break : Tbreak
+break : Tbreak Tendln
{$$ = mkexpr($1->loc, Obreak, NULL);}
;
-continue : Tcontinue
+continue : Tcontinue Tendln
{$$ = mkexpr($1->loc, Ocontinue, NULL);}
;
@@ -1006,7 +1004,7 @@ blkbody : decl {
}
;
-label : Tcolon Tident {
+label : Tcolon Tident Tendln {
char buf[512];
genlblstr(buf, sizeof buf, $2->id);
$$ = mklbl($2->loc, buf);