diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2012-07-12 09:36:56 -0700 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2012-07-13 10:20:50 -0700 |
| commit | 90e435e8082105f86f45a11186450ffb50653ffd (patch) | |
| tree | b9d9dfd85632310a4a2954bbf851d8662f161b49 /src/libsyntax/parse | |
| parent | 1fe0d8d7d70c78ea69647f765dd1bb780b5e6d86 (diff) | |
| download | rust-90e435e8082105f86f45a11186450ffb50653ffd.tar.gz rust-90e435e8082105f86f45a11186450ffb50653ffd.zip | |
change region syntax to &r/T in place of &r.T
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 4a013f20dfd..e1f3eb3217c 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -420,15 +420,20 @@ class parser { } } - // Parses something like "&x." (note the trailing dot) - fn parse_region_dot() -> @region { + // Parses something like "&x/" (note the trailing slash) + fn parse_region_with_sep() -> @region { let name = alt copy self.token { - token::IDENT(sid, _) if self.look_ahead(1u) == token::DOT { - self.bump(); self.bump(); - some(self.get_str(sid)) + token::IDENT(sid, _) => { + if self.look_ahead(1u) == token::DOT || // backwards compat + self.look_ahead(1u) == token::BINOP(token::SLASH) { + self.bump(); self.bump(); + some(self.get_str(sid)) + } else { + none + } } - _ { none } + _ => { none } }; self.region_from_name(name) } @@ -495,7 +500,7 @@ class parser { t } else if self.token == token::BINOP(token::AND) { self.bump(); - let region = self.parse_region_dot(); + let region = self.parse_region_with_sep(); let mt = self.parse_mt(); ty_rptr(region, mt) } else if self.eat_keyword("pure") { |
