diff options
| author | Steven Allen <steven@stebalien.com> | 2015-05-22 10:37:44 -0400 |
|---|---|---|
| committer | Steven Allen <steven@stebalien.com> | 2015-05-22 12:47:52 -0400 |
| commit | f21655ec0286769056c73f9b1c847936c577004b (patch) | |
| tree | 3d810dff3431ba98df386c0374c22f84ca1f79c0 /src/libsyntax | |
| parent | c3d60aba6c86883c79055c1a3923d4db116b644e (diff) | |
| download | rust-f21655ec0286769056c73f9b1c847936c577004b.tar.gz rust-f21655ec0286769056c73f9b1c847936c577004b.zip | |
Allow patterns to be followed by if and in.
Needed to support:
match X {
pattern if Y ...
}
for pattern in Y {}
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/tt/macro_rules.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index febfc7a97fe..03d4e21a941 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -495,6 +495,7 @@ fn is_in_follow(_: &ExtCtxt, tok: &Token, frag: &str) -> Result<bool, String> { "pat" => { match *tok { FatArrow | Comma | Eq => Ok(true), + Ident(i, _) if i.as_str() == "if" || i.as_str() == "in" => Ok(true), _ => Ok(false) } }, |
