Permalink
Browse files

update syntax to include a slash

  • Loading branch information...
1 parent 3c995fb commit 3d6c79109e869de58d6545f683b3e796237039fb @nikomatsakis nikomatsakis committed Apr 20, 2012
@@ -2249,7 +2249,12 @@ fn parse_item_type(p: parser, attrs: [ast::attribute]) -> @ast::item {
}
fn parse_region_param(p: parser) -> ast::region_param {
- if eat(p, token::BINOP(token::AND)) {ast::rp_self} else {ast::rp_none}
+ if eat(p, token::BINOP(token::SLASH)) {
+ expect(p, token::BINOP(token::AND));
+ ast::rp_self
+ } else {
+ ast::rp_none
+ }
}
fn parse_item_enum(p: parser, attrs: [ast::attribute]) -> @ast::item {
@@ -1407,7 +1407,7 @@ fn print_bounds(s: ps, bounds: @[ast::ty_param_bound]) {
fn print_region_param(s: ps, rp: ast::region_param) {
alt rp {
- ast::rp_self { word(s.s, "&") }
+ ast::rp_self { word(s.s, "/&") }
ast::rp_none { }
}
}
@@ -2,7 +2,7 @@ use std;
import std::arena;
import std::arena::arena;
-enum tree& { nil, node(&tree, &tree, int), }
+enum tree/& { nil, node(&tree, &tree, int), }
fn item_check(t: &tree) -> int {
alt *t {
@@ -1,4 +1,4 @@
-enum ast& {
+enum ast/& {
num(uint),
add(&ast, &ast)
}
@@ -10,15 +10,15 @@ enum no2 {
x2(&foo.uint) //! ERROR named regions other than `self` are not allowed as part of a type declaration
}
-enum yes0& {
+enum yes0/& {
x3(&uint)
}
-enum yes1& {
+enum yes1/& {
x4(&self.uint)
}
-enum yes2& {
+enum yes2/& {
x5(&foo.uint) //! ERROR named regions other than `self` are not allowed as part of a type declaration
}
@@ -7,13 +7,13 @@ resource no1(x: &self.uint) { //! ERROR to use region types here, the containing
resource no2(x: &foo.uint) { //! ERROR named regions other than `self` are not allowed as part of a type declaration
}
-resource yes0&(x: &uint) {
+resource yes0/&(x: &uint) {
}
-resource yes1&(x: &self.uint) {
+resource yes1/&(x: &self.uint) {
}
-resource yes2&(x: &foo.uint) { //! ERROR named regions other than `self` are not allowed as part of a type declaration
+resource yes2/&(x: &foo.uint) { //! ERROR named regions other than `self` are not allowed as part of a type declaration
}
fn main() {}
@@ -10,15 +10,15 @@ type item_ty_no2 = {
x: &foo.uint //! ERROR named regions other than `self` are not allowed as part of a type declaration
};
-type item_ty_yes0& = {
+type item_ty_yes0/& = {
x: &uint
};
-type item_ty_yes1& = {
+type item_ty_yes1/& = {
x: &self.uint
};
-type item_ty_yes2& = {
+type item_ty_yes2/& = {
x: &foo.uint //! ERROR named regions other than `self` are not allowed as part of a type declaration
};
@@ -2,11 +2,11 @@ import libc, sys, unsafe;
enum arena = ();
-type bcx& = {
+type bcx/& = {
fcx: &fcx
};
-type fcx& = {
+type fcx/& = {
arena: &arena,
ccx: &ccx
};
@@ -2,11 +2,11 @@ import libc, sys, unsafe;
enum arena = ();
-type bcx& = {
+type bcx/& = {
fcx: &fcx
};
-type fcx& = {
+type fcx/& = {
arena: &arena,
ccx: &ccx
};

0 comments on commit 3d6c791

Please sign in to comment.