diff options
| author | Eric Holk <eric.holk@gmail.com> | 2012-08-06 13:09:10 -0700 |
|---|---|---|
| committer | Eric Holk <eric.holk@gmail.com> | 2012-08-06 13:25:34 -0700 |
| commit | 517ad983f9f5ac7f805dd15cf6c6a156e02e3ec8 (patch) | |
| tree | 194520faef38ce641175fbef688c9c0b68837a15 /src/libsyntax/parse/parser.rs | |
| parent | 4544c015b3bd45b18612ede3e0c091ec3ee27e8a (diff) | |
| download | rust-517ad983f9f5ac7f805dd15cf6c6a156e02e3ec8.tar.gz rust-517ad983f9f5ac7f805dd15cf6c6a156e02e3ec8.zip | |
Handle interpolated paths in pattern parsing. Fixes #3007.
We might need to use is_ident_or_path in a for other places too.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 71bd87981bc..4a34b667937 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3,7 +3,8 @@ import print::pprust::expr_to_str; import result::result; import either::{either, left, right}; import std::map::{hashmap, str_hash}; -import token::{can_begin_expr, is_ident, is_plain_ident, INTERPOLATED}; +import token::{can_begin_expr, is_ident, is_ident_or_path, is_plain_ident, + INTERPOLATED}; import codemap::{span,fss_none}; import util::interner; import ast_util::{spanned, respan, mk_sp, ident_to_path, operator_prec}; @@ -1748,7 +1749,7 @@ class parser { } } tok => { - if !is_ident(tok) || + if !is_ident_or_path(tok) || self.is_keyword(~"true") || self.is_keyword(~"false") { let val = self.parse_expr_res(RESTRICT_NO_BAR_OP); if self.eat_keyword(~"to") { |
