mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
19 lines
561 B
Rust
19 lines
561 B
Rust
use crate::compiler::{CompileCtx, Compiler};
|
|
use oxide_parser::Statement;
|
|
|
|
mod break_continue;
|
|
mod expression;
|
|
mod labeled;
|
|
mod return_stmt;
|
|
|
|
impl Compiler {
|
|
pub(crate) fn emit_basic_domain(&self, stmt: &Statement, ctx: &mut CompileCtx) -> Result<Option<u8>, String> {
|
|
match stmt {
|
|
Statement::ExpressionStatement(_) => self.emit_basic_expression(stmt, ctx),
|
|
Statement::ReturnStatement(_) => self.emit_basic_return(stmt, ctx),
|
|
Statement::EmptyStatement(_) => Ok(None),
|
|
_ => Ok(None),
|
|
}
|
|
}
|
|
}
|