This repository has been archived on 2026-09-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
OxideJS/crates/oxide_compiler/src/stmt/exception/mod.rs
T
2026-08-05 10:27:28 +08:00

23 lines
689 B
Rust

use crate::compiler::{CompileCtx, Compiler};
use oxide_parser::Statement;
mod throw;
mod try_catch;
impl Compiler {
pub(crate) fn count_exception_domain(&self, stmt: &Statement, ctx: &mut CompileCtx) {
match stmt {
Statement::TryStatement(ts) => self.count_try_statement(ts, ctx),
_ => {}
}
}
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),
}
}
}