diff options
| author | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-10-28 11:05:28 +1100 |
|---|---|---|
| committer | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-10-28 15:55:38 +1100 |
| commit | 665ad9c175f746b78c7eae81432b543d2e16c3c9 (patch) | |
| tree | ef3ee489fe83735580ee2dcea9f82ad61296a07b /src/libsyntax/ext | |
| parent | cd049591a25973cd41ca5b69e7a151ae5fa0b71f (diff) | |
| download | rust-665ad9c175f746b78c7eae81432b543d2e16c3c9.tar.gz rust-665ad9c175f746b78c7eae81432b543d2e16c3c9.zip | |
Move token-to-string functions into print::pprust
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 6d30de96a3c..073bebcb3f6 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -87,6 +87,7 @@ use parse::attr::ParserAttr; use parse::parser::{LifetimeAndTypesWithoutColons, Parser}; use parse::token::{Token, Nonterminal}; use parse::token; +use print::pprust; use ptr::P; use std::rc::Rc; @@ -402,7 +403,7 @@ pub fn parse(sess: &ParseSess, nts, next_eis.len()).to_string()); } else if bb_eis.len() == 0u && next_eis.len() == 0u { return Failure(sp, format!("no rules expected the token `{}`", - token::to_string(&tok)).to_string()); + pprust::token_to_string(&tok)).to_string()); } else if next_eis.len() > 0u { /* Now process the next token */ while next_eis.len() > 0u { @@ -449,7 +450,7 @@ pub fn parse_nt(p: &mut Parser, name: &str) -> Nonterminal { "ident" => match p.token { token::Ident(sn,b) => { p.bump(); token::NtIdent(box sn,b) } _ => { - let token_str = token::to_string(&p.token); + let token_str = pprust::token_to_string(&p.token); p.fatal((format!("expected ident, found {}", token_str.as_slice())).as_slice()) } |
