diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2013-08-08 13:28:06 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2013-08-08 19:41:02 -0400 |
| commit | 33c6d3fd7880df371151ec3e9a053b7169a181e5 (patch) | |
| tree | 55df69841505538e605cc5389455cdc96120052b /src/libsyntax/ext | |
| parent | 8f65dbfcfa11aa521aa59881f6ab064bbd07184e (diff) | |
| download | rust-33c6d3fd7880df371151ec3e9a053b7169a181e5.tar.gz rust-33c6d3fd7880df371151ec3e9a053b7169a181e5.zip | |
Allow attributes to appear as macro arguments
Fixes #8393
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 5a1317034b2..918949113ad 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -17,6 +17,7 @@ use codemap; use parse::lexer::*; //resolve bug? use parse::ParseSess; use parse::parser::Parser; +use parse::attr::parser_attr; use parse::token::{Token, EOF, to_str, nonterminal, get_ident_interner, ident_to_str}; use parse::token; @@ -430,6 +431,7 @@ pub fn parse_nt(p: &Parser, name: &str) -> nonterminal { + token::to_str(get_ident_interner(), p.token)) }, "path" => token::nt_path(p.parse_path_with_tps(false)), + "attr" => token::nt_attr(@p.parse_attribute(false)), "tt" => { *p.quote_depth += 1u; //but in theory, non-quoted tts might be useful let res = token::nt_tt(@p.parse_token_tree()); |
