summaryrefslogtreecommitdiff
path: root/parse/gram.y
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-02-20 22:47:18 -0500
committerOri Bernstein <ori@eigenstate.org>2014-02-20 22:47:18 -0500
commit1efff8a755b22b20bec7c671c25a63825cfd90f1 (patch)
treeecc10904318b67384a2c005fffe02c0dad34b663 /parse/gram.y
parentf666a9b2a62c4f8588c6add2bcc2071f95ef357c (diff)
downloadmc-1efff8a755b22b20bec7c671c25a63825cfd90f1.tar.gz
Traits specialize!
Diffstat (limited to 'parse/gram.y')
-rw-r--r--parse/gram.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/parse/gram.y b/parse/gram.y
index 2cc8f37..6b93aa5 100644
--- a/parse/gram.y
+++ b/parse/gram.y
@@ -330,6 +330,7 @@ implbody
$$ = $1;
d = mkdecl($2->line, mkname($2->line, $2->str), mktyvar($2->line));
d->decl.init = $4;
+ d->decl.isconst = 1;
lappend(&$$.nl, &$$.nn, d);
}
;
@@ -338,7 +339,10 @@ traitdef: Ttrait Tident generictype Tendln /* trait prototype */ {
$$ = mktrait($1->line, mkname($2->line, $2->str), $3, NULL, 0, NULL, 0, 1);
}
| Ttrait Tident generictype Tasn traitbody Tendblk /* trait definition */ {
+ size_t i;
$$ = mktrait($1->line, mkname($2->line, $2->str), $3, NULL, 0, $5.nl, $5.nn, 0);
+ for (i = 0; i < $5.nn; i++)
+ $5.nl[i]->decl.isgeneric = 1;
}
;