summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-03-26 16:14:07 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-03-28 16:37:45 -0700
commitc6bbb95ce26e75214003190b643f5098e39b6428 (patch)
treeddeebe963d1c6ded3112ddbb6625ed02eb28e884 /src/libsyntax/ext
parentcbfc0a5e33eb3d97a2995d120536b8dadc0cc0a2 (diff)
downloadrust-c6bbb95ce26e75214003190b643f5098e39b6428.tar.gz
rust-c6bbb95ce26e75214003190b643f5098e39b6428.zip
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
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs2
1 files changed, 1 insertions, 1 deletions
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());