提交 b7d38743 编写于 作者: P Patrick Walton

rustc: Wrap regions in a node ID

上级 7b938d89
此差异已折叠。
......@@ -341,7 +341,9 @@ enum prim_ty {
ty_bool,
}
enum region {
type region = {id: node_id, node: region_};
enum region_ {
re_inferred,
re_named(ident),
re_self
......
......@@ -417,7 +417,7 @@ fn parse_ret_ty(p: parser) -> (ast::ret_style, @ast::ty) {
}
fn parse_region(p: parser) -> ast::region {
alt p.token {
let region_ = alt p.token {
token::IDENT(sid, _) if p.look_ahead(1u) == token::DOT {
let string = p.get_str(sid);
p.bump(); p.bump();
......@@ -428,7 +428,8 @@ fn parse_region(p: parser) -> ast::region {
}
}
_ { ast::re_inferred }
}
};
ret {id: p.get_id(), node: region_};
}
fn parse_ty(p: parser, colons_before_params: bool) -> @ast::ty {
......
......@@ -314,7 +314,7 @@ fn print_native_mod(s: ps, nmod: ast::native_mod, attrs: [ast::attribute]) {
}
fn print_region(s: ps, region: ast::region) {
alt region {
alt region.node {
ast::re_inferred { /* no-op */ }
ast::re_named(name) { word(s.s, name); word(s.s, "."); }
ast::re_self { word(s.s, "self"); word(s.s, "."); }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册