use super::*; pub struct Ident { pub inner: String, } impl FmtNode for Ident { fn fmt(&self, f: &mut std::fmt::Formatter, _: DisplayCtx) -> std::fmt::Result { write!(f, "{}", self.inner) } } impl Parsable for Ident { fn parse(ctx: &mut super::ParseCtx) -> Result { match ctx.expect_next()? { Token::Ident(ident) => Ok(Self { inner: ident }), t => ctx.unexpected(&t, "an identifier"), } } }