diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2012-04-19 20:05:50 -0700 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2012-04-19 21:01:11 -0700 |
| commit | 3d6c79109e869de58d6545f683b3e796237039fb (patch) | |
| tree | 339f570d9530df783143415f618af03f76648788 /src | |
| parent | 3c995fb8f3676a313f5ac883e175cc5fe354e640 (diff) | |
| download | rust-3d6c79109e869de58d6545f683b3e796237039fb.tar.gz rust-3d6c79109e869de58d6545f683b3e796237039fb.zip | |
update syntax to include a slash
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustsyntax/parse/parser.rs | 7 | ||||
| -rw-r--r-- | src/librustsyntax/print/pprust.rs | 2 | ||||
| -rw-r--r-- | src/test/bench/shootout-binarytrees.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/regions-creating-enums.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/regions-in-enums.rs | 6 | ||||
| -rw-r--r-- | src/test/compile-fail/regions-in-rsrcs.rs | 6 | ||||
| -rw-r--r-- | src/test/compile-fail/regions-in-type-items.rs | 6 | ||||
| -rw-r--r-- | src/test/run-pass/regions-mock-trans-impls.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/regions-mock-trans.rs | 4 |
9 files changed, 22 insertions, 17 deletions
diff --git a/src/librustsyntax/parse/parser.rs b/src/librustsyntax/parse/parser.rs index 8b1fc2d6ada..d891275db5d 100644 --- a/src/librustsyntax/parse/parser.rs +++ b/src/librustsyntax/parse/parser.rs @@ -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 { diff --git a/src/librustsyntax/print/pprust.rs b/src/librustsyntax/print/pprust.rs index d5be2d12bc9..52673a548ec 100644 --- a/src/librustsyntax/print/pprust.rs +++ b/src/librustsyntax/print/pprust.rs @@ -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 { } } } diff --git a/src/test/bench/shootout-binarytrees.rs b/src/test/bench/shootout-binarytrees.rs index bbe6667ced6..3418f3d92c0 100644 --- a/src/test/bench/shootout-binarytrees.rs +++ b/src/test/bench/shootout-binarytrees.rs @@ -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 { diff --git a/src/test/compile-fail/regions-creating-enums.rs b/src/test/compile-fail/regions-creating-enums.rs index ae90feadd57..226039f4c2a 100644 --- a/src/test/compile-fail/regions-creating-enums.rs +++ b/src/test/compile-fail/regions-creating-enums.rs @@ -1,4 +1,4 @@ -enum ast& { +enum ast/& { num(uint), add(&ast, &ast) } diff --git a/src/test/compile-fail/regions-in-enums.rs b/src/test/compile-fail/regions-in-enums.rs index 4585c781739..4126ef75547 100644 --- a/src/test/compile-fail/regions-in-enums.rs +++ b/src/test/compile-fail/regions-in-enums.rs @@ -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 } diff --git a/src/test/compile-fail/regions-in-rsrcs.rs b/src/test/compile-fail/regions-in-rsrcs.rs index 3b0e61d6163..1c8e6c003ed 100644 --- a/src/test/compile-fail/regions-in-rsrcs.rs +++ b/src/test/compile-fail/regions-in-rsrcs.rs @@ -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() {} \ No newline at end of file diff --git a/src/test/compile-fail/regions-in-type-items.rs b/src/test/compile-fail/regions-in-type-items.rs index 80d734d9992..49202a340a1 100644 --- a/src/test/compile-fail/regions-in-type-items.rs +++ b/src/test/compile-fail/regions-in-type-items.rs @@ -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 }; diff --git a/src/test/run-pass/regions-mock-trans-impls.rs b/src/test/run-pass/regions-mock-trans-impls.rs index 4801524c55f..e761cefab58 100644 --- a/src/test/run-pass/regions-mock-trans-impls.rs +++ b/src/test/run-pass/regions-mock-trans-impls.rs @@ -2,11 +2,11 @@ import libc, sys, unsafe; enum arena = (); -type bcx& = { +type bcx/& = { fcx: &fcx }; -type fcx& = { +type fcx/& = { arena: &arena, ccx: &ccx }; diff --git a/src/test/run-pass/regions-mock-trans.rs b/src/test/run-pass/regions-mock-trans.rs index 959319381c6..4568bca444c 100644 --- a/src/test/run-pass/regions-mock-trans.rs +++ b/src/test/run-pass/regions-mock-trans.rs @@ -2,11 +2,11 @@ import libc, sys, unsafe; enum arena = (); -type bcx& = { +type bcx/& = { fcx: &fcx }; -type fcx& = { +type fcx/& = { arena: &arena, ccx: &ccx }; |
