Skip to content

Commit 1d4c498

Browse files
committed
---
yaml --- r: 975 b: refs/heads/master c: e6b7f76 h: refs/heads/master i: 973: 58e0e31 971: 92b67ba 967: 03ee295 959: 0db4a83 v: v3
1 parent 12313e2 commit 1d4c498

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 3e08171fc21f7fcc403aa315d8fb54f04c552841
2+
refs/heads/master: e6b7f763853d0d847288111e7050841e05a885f4

trunk/src/comp/front/ast.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ tag ty_ {
153153
ty_box(@ty);
154154
ty_vec(@ty);
155155
ty_tup(vec[@ty]);
156+
ty_rec(vec[tup(ident,@ty)]);
156157
ty_fn(vec[rec(mode mode, @ty ty)], @ty); // TODO: effect
157158
ty_path(path, option.t[def]);
158159
ty_mutable(@ty);

trunk/src/comp/front/parser.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,23 @@ impure fn parse_ty(parser p) -> @ast.ty {
187187
t = ast.ty_tup(elems.node);
188188
}
189189

190+
case (token.REC) {
191+
p.bump();
192+
impure fn parse_field(parser p) -> tup(ast.ident, @ast.ty) {
193+
auto ty = parse_ty(p);
194+
auto id = parse_ident(p);
195+
ret tup(id,ty);
196+
}
197+
auto f = parse_field; // FIXME: trans_const_lval bug
198+
auto elems =
199+
parse_seq[tup(ast.ident, @ast.ty)](token.LPAREN,
200+
token.RPAREN,
201+
some(token.COMMA),
202+
f, p);
203+
hi = p.get_span();
204+
t = ast.ty_rec(elems.node);
205+
}
206+
190207
case (token.MUTABLE) {
191208
p.bump();
192209
auto t0 = parse_ty(p);

0 commit comments

Comments
 (0)