mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-23 18:21:13 +08:00
18 lines
516 B
Rust
18 lines
516 B
Rust
//! 异常语句域:throw/try 的分发与子模块聚合。
|
|
|
|
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<u32>, String> {
|
|
match stmt {
|
|
Statement::ThrowStatement(_) => self.emit_throw_statement(stmt, ctx),
|
|
Statement::TryStatement(_) => self.emit_try_statement(stmt, ctx),
|
|
_ => Ok(None),
|
|
}
|
|
}
|
|
}
|