syntax: Allow pretty printing more interpolated items

This commit is contained in:
Erick Tryzelaar 2015-05-01 11:27:36 -07:00
parent 7ebaf1c5c6
commit eef6b4a37b

View file

@ -287,19 +287,19 @@ pub fn token_to_string(tok: &Token) -> String {
token::SpecialVarNt(var) => format!("${}", var.as_str()),
token::Interpolated(ref nt) => match *nt {
token::NtExpr(ref e) => expr_to_string(&**e),
token::NtMeta(ref e) => meta_item_to_string(&**e),
token::NtTy(ref e) => ty_to_string(&**e),
token::NtPath(ref e) => path_to_string(&**e),
token::NtItem(..) => "an interpolated item".to_string(),
token::NtBlock(..) => "an interpolated block".to_string(),
token::NtStmt(..) => "an interpolated statement".to_string(),
token::NtPat(..) => "an interpolated pattern".to_string(),
token::NtIdent(..) => "an interpolated identifier".to_string(),
token::NtTT(..) => "an interpolated tt".to_string(),
token::NtArm(..) => "an interpolated arm".to_string(),
token::NtImplItem(..) => "an interpolated impl item".to_string(),
token::NtTraitItem(..) => "an interpolated trait item".to_string(),
token::NtExpr(ref e) => expr_to_string(&**e),
token::NtMeta(ref e) => meta_item_to_string(&**e),
token::NtTy(ref e) => ty_to_string(&**e),
token::NtPath(ref e) => path_to_string(&**e),
token::NtItem(ref e) => item_to_string(&**e),
token::NtBlock(ref e) => block_to_string(&**e),
token::NtStmt(ref e) => stmt_to_string(&**e),
token::NtPat(ref e) => pat_to_string(&**e),
token::NtIdent(ref e) => ident_to_string(&**e),
token::NtTT(ref e) => tt_to_string(&**e),
token::NtArm(ref e) => arm_to_string(&**e),
token::NtImplItem(ref e) => impl_item_to_string(&**e),
token::NtTraitItem(ref e) => trait_item_to_string(&**e),
}
}
}