rustc: Parse istr and ivec
This commit is contained in:
@@ -346,6 +346,8 @@ tag ty_ {
|
|||||||
ty_obj(vec[ty_method]);
|
ty_obj(vec[ty_method]);
|
||||||
ty_path(path, ann);
|
ty_path(path, ann);
|
||||||
ty_type;
|
ty_type;
|
||||||
|
ty_ivec(@ty); // interior vector
|
||||||
|
ty_istr; // interior string
|
||||||
ty_constr(@ty, vec[@constr]);
|
ty_constr(@ty, vec[@constr]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -485,6 +485,7 @@ fn parse_ty(&parser p) -> @ast::ty {
|
|||||||
else if (eat_word(p, "uint")) { t = ast::ty_uint; }
|
else if (eat_word(p, "uint")) { t = ast::ty_uint; }
|
||||||
else if (eat_word(p, "float")) { t = ast::ty_float; }
|
else if (eat_word(p, "float")) { t = ast::ty_float; }
|
||||||
else if (eat_word(p, "str")) { t = ast::ty_str; }
|
else if (eat_word(p, "str")) { t = ast::ty_str; }
|
||||||
|
else if (eat_word(p, "istr")) { t = ast::ty_istr; }
|
||||||
else if (eat_word(p, "char")) { t = ast::ty_char; }
|
else if (eat_word(p, "char")) { t = ast::ty_char; }
|
||||||
else if (eat_word(p, "task")) { t = ast::ty_task; }
|
else if (eat_word(p, "task")) { t = ast::ty_task; }
|
||||||
else if (eat_word(p, "i8")) { t = ast::ty_machine(common::ty_i8); }
|
else if (eat_word(p, "i8")) { t = ast::ty_machine(common::ty_i8); }
|
||||||
@@ -570,6 +571,11 @@ fn parse_ty(&parser p) -> @ast::ty {
|
|||||||
t = ast::ty_chan(parse_ty(p));
|
t = ast::ty_chan(parse_ty(p));
|
||||||
hi = p.get_hi_pos();
|
hi = p.get_hi_pos();
|
||||||
expect(p, token::RBRACKET);
|
expect(p, token::RBRACKET);
|
||||||
|
} else if (eat_word(p, "ivec")) {
|
||||||
|
expect(p, token::LBRACKET);
|
||||||
|
t = ast::ty_ivec(parse_ty(p));
|
||||||
|
hi = p.get_hi_pos();
|
||||||
|
expect(p, token::RBRACKET);
|
||||||
} else if (eat_word(p, "mutable")) {
|
} else if (eat_word(p, "mutable")) {
|
||||||
p.get_session().span_warn(p.get_span(),
|
p.get_session().span_warn(p.get_span(),
|
||||||
"ignoring deprecated 'mutable' type constructor");
|
"ignoring deprecated 'mutable' type constructor");
|
||||||
|
|||||||
Reference in New Issue
Block a user