From c6bbb95ce26e75214003190b643f5098e39b6428 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 26 Mar 2014 16:14:07 -0700 Subject: syntax: Accept meta matchers in macros This removes the `attr` matcher and adds a `meta` matcher. The previous `attr` matcher is now ambiguous because it doesn't disambiguate whether it means inner attribute or outer attribute. The new behavior can still be achieved by taking an argument of the form `#[$foo:meta]` (the brackets are part of the macro pattern). Closes #13067 --- src/libsyntax/ext/tt/macro_parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsyntax/ext') diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index aa4f192f779..0d90093a40f 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -441,7 +441,7 @@ pub fn parse_nt(p: &mut Parser, name: &str) -> Nonterminal { "path" => { token::NtPath(~p.parse_path(LifetimeAndTypesWithoutColons).path) } - "attr" => token::NtAttr(@p.parse_attribute(false)), + "meta" => token::NtMeta(p.parse_meta_item()), "tt" => { p.quote_depth += 1u; //but in theory, non-quoted tts might be useful let res = token::NtTT(@p.parse_token_tree()); -- cgit 1.4.1-3-g733a5