refactor: 完成语法域入口点迁移,收紧内部方法可见性
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user