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::counter) fn count_switch_statement(
&self, stmt: &oxide_parser::SwitchStatement<'_>, ctx: &mut CompileCtx,
) {
fn count_switch_statement(&self, stmt: &oxide_parser::SwitchStatement<'_>, ctx: &mut CompileCtx) {
let id = ctx.next_label_id();
let end_label = Label::SwitchEnd(id);
ctx.push_switch(end_label);
@@ -38,4 +36,10 @@ impl Compiler {
ctx.labels.label_map.insert(end_label, ctx.projected_pc);
ctx.pop_switch();
}
pub(in crate::counter) fn count_switch_domain(&self, stmt: &Statement, ctx: &mut CompileCtx) {
if let Statement::SwitchStatement(sw) = stmt {
self.count_switch_statement(sw, ctx);
}
}
}