diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-08-07 09:47:28 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-08-27 18:46:51 -0700 |
| commit | 3b6314c39bfc13b5a41c53f13c3fafa7ad91e062 (patch) | |
| tree | f43929dd9d9874c8cd95a69f7c47313b2bcf055a /src/libsyntax/ext/tt | |
| parent | 5c3504799deb78d986f8267f753a87fb9e73a452 (diff) | |
| download | rust-3b6314c39bfc13b5a41c53f13c3fafa7ad91e062.tar.gz rust-3b6314c39bfc13b5a41c53f13c3fafa7ad91e062.zip | |
librustc: Add support for type parameters in the middle of paths.
For example, `foo::<T>::bar::<U>`. This doesn't enforce that the type parameters are in the right positions, however.
Diffstat (limited to 'src/libsyntax/ext/tt')
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index c208a7f7e3e..327ee331c38 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -16,8 +16,8 @@ use codemap::{BytePos, mk_sp}; use codemap; use parse::lexer::*; //resolve bug? use parse::ParseSess; -use parse::parser::Parser; use parse::attr::parser_attr; +use parse::parser::{LifetimeAndTypesWithoutColons, Parser}; use parse::token::{Token, EOF, to_str, nonterminal, get_ident_interner, ident_to_str}; use parse::token; @@ -430,7 +430,9 @@ pub fn parse_nt(p: &Parser, name: &str) -> nonterminal { _ => p.fatal(~"expected ident, found " + token::to_str(get_ident_interner(), p.token)) }, - "path" => token::nt_path(~p.parse_path_with_tps(false)), + "path" => { + token::nt_path(~p.parse_path(LifetimeAndTypesWithoutColons).path) + } "attr" => token::nt_attr(@p.parse_attribute(false)), "tt" => { *p.quote_depth += 1u; //but in theory, non-quoted tts might be useful |
