x86_64 arch + asm start
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
use crate::parser::{Node, cursor::Token};
|
||||
|
||||
pub mod x86_64;
|
||||
|
||||
pub enum AsmBlock {
|
||||
X86_64(x86_64::Asm),
|
||||
}
|
||||
|
||||
impl Node for AsmBlock {
|
||||
fn parse(ctx: &mut crate::parser::ParseCtx) -> Result<Self, crate::io::CompilerMsg> {
|
||||
ctx.expect(Token::OpenCurly)?;
|
||||
let asm = ctx.parse()?;
|
||||
ctx.expect(Token::CloseCurly)?;
|
||||
Ok(Self::X86_64(asm))
|
||||
}
|
||||
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter, ctx: crate::parser::DisplayCtx) -> std::fmt::Result {
|
||||
write!(f, "asm {{ ... }}")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user