diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-03-26 16:14:07 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-03-28 16:37:45 -0700 |
| commit | c6bbb95ce26e75214003190b643f5098e39b6428 (patch) | |
| tree | ddeebe963d1c6ded3112ddbb6625ed02eb28e884 /src/libsyntax/ext | |
| parent | cbfc0a5e33eb3d97a2995d120536b8dadc0cc0a2 (diff) | |
| download | rust-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.rs | 2 |
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()); |
