mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 11:11:11 +08:00
refactor: 完成语法域入口点迁移,收紧内部方法可见性
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use super::*;
|
||||
|
||||
impl Compiler {
|
||||
pub(in crate::counter) fn count_conditional_expression(&self, expr: &Expression, ctx: &mut CompileCtx) {
|
||||
fn count_conditional_expression(&self, expr: &Expression, ctx: &mut CompileCtx) {
|
||||
let Expression::ConditionalExpression(cond) = expr else {
|
||||
return;
|
||||
};
|
||||
@@ -21,7 +21,7 @@ impl Compiler {
|
||||
ctx.labels.label_map.insert(end_label, ctx.projected_pc);
|
||||
}
|
||||
|
||||
pub(in crate::counter) fn count_sequence_expression(&self, expr: &Expression, ctx: &mut CompileCtx) {
|
||||
fn count_sequence_expression(&self, expr: &Expression, ctx: &mut CompileCtx) {
|
||||
let Expression::SequenceExpression(seq) = expr else {
|
||||
return;
|
||||
};
|
||||
@@ -30,7 +30,7 @@ impl Compiler {
|
||||
}
|
||||
}
|
||||
|
||||
pub(in crate::counter) fn count_logical_expression(&self, expr: &Expression, ctx: &mut CompileCtx) {
|
||||
fn count_logical_expression(&self, expr: &Expression, ctx: &mut CompileCtx) {
|
||||
let Expression::LogicalExpression(log) = expr else {
|
||||
return;
|
||||
};
|
||||
@@ -61,4 +61,13 @@ impl Compiler {
|
||||
ctx.labels.label_map.insert(skip_label, ctx.projected_pc);
|
||||
}
|
||||
}
|
||||
|
||||
pub(in crate::counter) fn count_conditional_chain(&self, expr: &Expression, ctx: &mut CompileCtx) {
|
||||
match expr {
|
||||
Expression::ConditionalExpression(_) => self.count_conditional_expression(expr, ctx),
|
||||
Expression::SequenceExpression(_) => self.count_sequence_expression(expr, ctx),
|
||||
Expression::LogicalExpression(_) => self.count_logical_expression(expr, ctx),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user