refactor: 移除简单表达式计数辅助

This commit is contained in:
2026-08-05 01:10:03 +08:00
parent 198bb7d428
commit dfc14cfce9
11 changed files with 1 additions and 193 deletions
@@ -3,20 +3,7 @@ use oxide_bytecode::{
module::Constant,
opcode::{self, OpCode},
};
use oxide_parser::Expression;
impl Compiler {
pub(crate) fn count_template_literal(&self, expr: &Expression, ctx: &mut CompileCtx) {
let Expression::TemplateLiteral(tl) = expr else {
return;
};
for expr in &tl.expressions {
self.count_expression(expr, ctx);
}
let segment_count = tl.quasis.len() + tl.expressions.len();
ctx.count_template_str(segment_count);
}
pub(crate) fn emit_template_literal_expression(
&self, tl: &oxide_parser::TemplateLiteral, ctx: &mut CompileCtx,
) -> Result<u8, String> {