refactor: 拆分 oxide_emit 为独立 emit pass crate(依赖倒置)

This commit is contained in:
2026-08-05 20:13:18 +08:00
parent 4f670eb7fd
commit 7c8f19f61a
62 changed files with 1045 additions and 993 deletions
@@ -0,0 +1,15 @@
use crate::{CompileCtx, Emitter};
use oxide_parser::Statement;
mod throw;
mod try_catch;
impl Emitter {
pub(crate) fn emit_exception_domain(&self, stmt: &Statement, ctx: &mut CompileCtx) -> Result<Option<u8>, String> {
match stmt {
Statement::ThrowStatement(_) => self.emit_throw_statement(stmt, ctx),
Statement::TryStatement(_) => self.emit_try_statement(stmt, ctx),
_ => Ok(None),
}
}
}