From af556238ebe72d58adbcf339bd2fa0aef4e3caf9 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sun, 12 Jul 2015 15:53:04 -0700 Subject: syntax: Allow semi tokens after macro ty/path This commit expands the follow set of the `ty` and `path` macro fragments to include the semicolon token as well. A semicolon is already allowed after these tokens, so it's currently a little too restrictive to not have a semicolon allowed. For example: extern { fn foo() -> i32; // semicolon after type } fn main() { struct Foo; Foo; // semicolon after path } --- src/libsyntax/ext/tt/macro_rules.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index 03d4e21a941..634572d4694 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -501,7 +501,7 @@ fn is_in_follow(_: &ExtCtxt, tok: &Token, frag: &str) -> Result { }, "path" | "ty" => { match *tok { - Comma | FatArrow | Colon | Eq | Gt => Ok(true), + Comma | FatArrow | Colon | Eq | Gt | Semi => Ok(true), Ident(i, _) if i.as_str() == "as" => Ok(true), _ => Ok(false) } -- cgit 1.4.1-3-g733a5