Skip to content

Commit

Permalink
Fix parsing of patterns in macros
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed Apr 2, 2015
1 parent 35c1bdb commit 76567a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libsyntax/parse/parser.rs
Expand Up @@ -3160,7 +3160,9 @@ impl<'a> Parser<'a> {
// Parse pattern starting with a path
if self.token.is_plain_ident() && self.look_ahead(1, |t| *t != token::DotDotDot &&
*t != token::OpenDelim(token::Brace) &&
*t != token::OpenDelim(token::Paren)) {
*t != token::OpenDelim(token::Paren) &&
// Contrary to its definition, a plain ident can be followed by :: in macros
*t != token::ModSep) {
// Plain idents have some extra abilities here compared to general paths
if self.look_ahead(1, |t| *t == token::Not) {
// Parse macro invocation
Expand Down

0 comments on commit 76567a6

Please sign in to comment.