x86_64 arch + asm start

This commit is contained in:
2026-06-02 03:24:21 -04:00
parent c2a8c50a6d
commit 473ddab0d4
12 changed files with 200 additions and 11 deletions
+4 -1
View File
@@ -45,6 +45,7 @@ pub enum ExprTy {
Import(Ident),
Fn(Box<Func>),
Break,
Asm(AsmBlock),
}
impl Node for Expr {
@@ -162,6 +163,7 @@ impl ExprTy {
Self::Break => {
write!(f, "break")
}
Self::Asm(asm) => asm.fmt(f, ctx),
}
}
}
@@ -216,6 +218,7 @@ impl Expr {
let ident = ctx.parse()?;
ExprTy::Import(ident)
}
Token::Asm => ExprTy::Asm(ctx.parse()?),
other => return ctx.unexpected(other, "an expression"),
};
Ok(Self {
@@ -258,7 +261,7 @@ impl Expr {
| ExprTy::If { body, .. }
| ExprTy::Negate(body)
| ExprTy::Assign { val: body, .. } => body.ends_with_block(),
| ExprTy::Define { val: body, .. } => body.ends_with_block(),
ExprTy::Define { val: body, .. } => body.ends_with_block(),
ExprTy::Fn(f) => f.ends_with_block(),
_ => false,
}