Some cleanup of no longer used AST things

This commit is contained in:
Nick Cameron
2015-09-30 17:18:09 +13:00
parent 21205f4f9e
commit ba43c228b5
14 changed files with 19 additions and 68 deletions

View File

@@ -29,7 +29,6 @@ use std::io::{self, Read};
use serialize::{Encodable, Decodable, Encoder, Decoder};
use parse::token::intern;
use ast::Name;
// _____________________________________________________________________________
@@ -269,28 +268,8 @@ pub enum ExpnFormat {
MacroAttribute(Name),
/// e.g. `format!()`
MacroBang(Name),
/// Syntax sugar expansion performed by the compiler (libsyntax::expand).
CompilerExpansion(CompilerExpansionFormat),
}
#[derive(Clone, Copy, Hash, Debug, PartialEq, Eq)]
pub enum CompilerExpansionFormat {
IfLet,
PlacementIn,
WhileLet,
ForLoop,
}
impl CompilerExpansionFormat {
pub fn name(self) -> &'static str {
match self {
CompilerExpansionFormat::IfLet => "if let expansion",
CompilerExpansionFormat::PlacementIn => "placement-in expansion",
CompilerExpansionFormat::WhileLet => "while let expansion",
CompilerExpansionFormat::ForLoop => "for loop expansion",
}
}
}
#[derive(Clone, Hash, Debug)]
pub struct NameAndSpan {
/// The format with which the macro was invoked.
@@ -310,7 +289,6 @@ impl NameAndSpan {
match self.format {
ExpnFormat::MacroAttribute(s) => s,
ExpnFormat::MacroBang(s) => s,
ExpnFormat::CompilerExpansion(ce) => intern(ce.name()),
}
}
}