/// table) and a SyntaxContext to track renaming and
/// macro expansion per Flatt et al., "Macros
/// That Work Together"
-#[deriving(Clone, Hash, PartialOrd, Eq, Ord, Show)]
+#[deriving(Clone, Hash, PartialOrd, Eq, Ord)]
pub struct Ident {
pub name: Name,
pub ctxt: SyntaxContext
pub fn new(name: Name) -> Ident { Ident {name: name, ctxt: EMPTY_CTXT}}
}
+impl Show for Ident {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ write!(f, "\"{}\"#{}", token::get_ident(*self).get(), self.ctxt)
+ }
+}
+
impl PartialEq for Ident {
fn eq(&self, other: &Ident) -> bool {
if self.ctxt == other.ctxt {
}
fn next_token(&mut self) -> TokenAndSpan {
let r = tt_next_token(self);
- debug!("TtReader: r={:?}", r);
+ debug!("TtReader: r={}", r);
r
}
fn fatal(&self, m: &str) -> ! {