Skip to content

Commit 54d34be

Browse files
committed
rustc: Parse istr and ivec
1 parent 1cc3fe5 commit 54d34be

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/comp/front/ast.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ tag ty_ {
346346
ty_obj(vec[ty_method]);
347347
ty_path(path, ann);
348348
ty_type;
349+
ty_ivec(@ty); // interior vector
350+
ty_istr; // interior string
349351
ty_constr(@ty, vec[@constr]);
350352
}
351353

src/comp/front/parser.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ fn parse_ty(&parser p) -> @ast::ty {
485485
else if (eat_word(p, "uint")) { t = ast::ty_uint; }
486486
else if (eat_word(p, "float")) { t = ast::ty_float; }
487487
else if (eat_word(p, "str")) { t = ast::ty_str; }
488+
else if (eat_word(p, "istr")) { t = ast::ty_istr; }
488489
else if (eat_word(p, "char")) { t = ast::ty_char; }
489490
else if (eat_word(p, "task")) { t = ast::ty_task; }
490491
else if (eat_word(p, "i8")) { t = ast::ty_machine(common::ty_i8); }
@@ -570,6 +571,11 @@ fn parse_ty(&parser p) -> @ast::ty {
570571
t = ast::ty_chan(parse_ty(p));
571572
hi = p.get_hi_pos();
572573
expect(p, token::RBRACKET);
574+
} else if (eat_word(p, "ivec")) {
575+
expect(p, token::LBRACKET);
576+
t = ast::ty_ivec(parse_ty(p));
577+
hi = p.get_hi_pos();
578+
expect(p, token::RBRACKET);
573579
} else if (eat_word(p, "mutable")) {
574580
p.get_session().span_warn(p.get_span(),
575581
"ignoring deprecated 'mutable' type constructor");

0 commit comments

Comments
 (0)