This commit is contained in:
2026-04-17 01:49:43 -04:00
parent e5ae506a84
commit 2f91e454dd
16 changed files with 268 additions and 401 deletions
+2 -4
View File
@@ -1,19 +1,17 @@
use super::*;
pub enum Type {
Ident(Id<Ident>),
Ident(Parsed<Ident>),
}
impl Parsable for Type {
impl Node for Type {
fn parse(ctx: &mut ParseCtx) -> Result<Self, CompilerMsg> {
Ok(match ctx.expect_next()? {
Token::Ident(s) => Self::Ident(ctx.ident(s)),
t => ctx.unexpected(&t, "a type")?,
})
}
}
impl FmtNode for Type {
fn fmt(&self, f: &mut std::fmt::Formatter, ctx: DisplayCtx) -> std::fmt::Result {
match self {
Type::Ident(id) => id.fmt(f, ctx),