diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-11-18 00:17:48 +0100 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2016-01-07 20:53:33 +0100 |
| commit | 3703ef582087b187f3989548c3a059f7d45503fa (patch) | |
| tree | 0b96136dbe0efd1cfcdc86103d47aa5d193a5eb9 /src/libsyntax/ext | |
| parent | 076e64475a54bacf7b0f0040e48800bca9b728dd (diff) | |
| download | rust-3703ef582087b187f3989548c3a059f7d45503fa.tar.gz rust-3703ef582087b187f3989548c3a059f7d45503fa.zip | |
extending FOLLOW(NT) as specified in amendment.
See RFC amendment 1384: https://github.com/rust-lang/rfcs/pull/1384
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/tt/macro_rules.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index add10612cd8..9f069cb17ed 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -997,15 +997,18 @@ fn is_in_follow(_: &ExtCtxt, tok: &Token, frag: &str) -> Result<bool, String> { }, "pat" => { match *tok { - FatArrow | Comma | Eq => Ok(true), - Ident(i, _) if i.name.as_str() == "if" || i.name.as_str() == "in" => Ok(true), + FatArrow | Comma | Eq | BinOp(token::Or) => Ok(true), + Ident(i, _) if (i.name.as_str() == "if" || + i.name.as_str() == "in") => Ok(true), _ => Ok(false) } }, "path" | "ty" => { match *tok { - Comma | FatArrow | Colon | Eq | Gt | Semi => Ok(true), - Ident(i, _) if i.name.as_str() == "as" => Ok(true), + OpenDelim(token::DelimToken::Brace) | + Comma | FatArrow | Colon | Eq | Gt | Semi | BinOp(token::Or) => Ok(true), + Ident(i, _) if (i.name.as_str() == "as" || + i.name.as_str() == "where") => Ok(true), _ => Ok(false) } }, |
