Rename TokenTree variants for clarity

This should be clearer, and fits in better with the `TTNonterminal` variant.

Renames:

- `TTTok` -> `TTToken`
- `TTDelim` -> `TTDelimited`
- `TTSeq` -> `TTSequence`
This commit is contained in:
Brendan Zabarauskas
2014-10-22 23:35:32 +11:00
parent 971d776aa5
commit ec3f0201e7
14 changed files with 98 additions and 95 deletions

View File

@@ -1020,14 +1020,14 @@ impl<'a> State<'a> {
/// expression arguments as expressions). It can be done! I think.
pub fn print_tt(&mut self, tt: &ast::TokenTree) -> IoResult<()> {
match *tt {
ast::TTDelim(_, ref open, ref tts, ref close) => {
ast::TTDelimited(_, ref open, ref tts, ref close) => {
try!(word(&mut self.s, parse::token::to_string(&open.token).as_slice()));
try!(space(&mut self.s));
try!(self.print_tts(tts.as_slice()));
try!(space(&mut self.s));
word(&mut self.s, parse::token::to_string(&close.token).as_slice())
},
ast::TTTok(_, ref tk) => {
ast::TTToken(_, ref tk) => {
try!(word(&mut self.s, parse::token::to_string(tk).as_slice()));
match *tk {
parse::token::DOC_COMMENT(..) => {
@@ -1036,7 +1036,7 @@ impl<'a> State<'a> {
_ => Ok(())
}
}
ast::TTSeq(_, ref tts, ref sep, zerok) => {
ast::TTSequence(_, ref tts, ref sep, zerok) => {
try!(word(&mut self.s, "$("));
for tt_elt in (*tts).iter() {
try!(self.print_tt(tt_elt));