mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 19:21:11 +08:00
refactor: 拆分 oxide_emit 为独立 emit pass crate(依赖倒置)
This commit is contained in:
@@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user