refactor: 完成语法域入口点迁移,收紧内部方法可见性

This commit is contained in:
爱特每羊队
2026-06-25 21:53:26 +08:00
parent db0444dabd
commit 3596fc3430
33 changed files with 403 additions and 222 deletions
@@ -1,9 +1,7 @@
use super::*;
impl Compiler {
pub(in crate::emitter) fn emit_if_statement(
&self, stmt: &Statement, ctx: &mut CompileCtx,
) -> Result<Option<u8>, String> {
fn emit_if_statement(&self, stmt: &Statement, ctx: &mut CompileCtx) -> Result<Option<u8>, String> {
let Statement::IfStatement(ifs) = stmt else {
return Ok(None);
};
@@ -46,4 +44,13 @@ impl Compiler {
Ok(Some(result_reg))
}
pub(in crate::emitter) fn emit_control_domain(
&self, stmt: &Statement, ctx: &mut CompileCtx,
) -> Result<Option<u8>, String> {
match stmt {
Statement::IfStatement(_) => self.emit_if_statement(stmt, ctx),
_ => Ok(None),
}
}
}