This repository has been archived on 2026-09-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
OxideJS/crates/oxide_emit/src/expr/template/mod.rs
T

18 lines
619 B
Rust

//! 模板字符串域:普通/标签模板子模块与域分发 `emit_template_domain`。
use crate::{CompileCtx, Emitter};
use oxide_parser::Expression;
mod tagged;
mod template_literal;
impl Emitter {
pub(crate) fn emit_template_domain(&self, expr: &Expression, ctx: &mut CompileCtx) -> Result<u32, String> {
match expr {
Expression::TemplateLiteral(tl) => self.emit_template_literal_expression(tl, ctx),
Expression::TaggedTemplateExpression(tt) => self.emit_tagged_template_expression(tt, ctx),
_ => self.emit_unsupported_expression(expr, ctx),
}
}
}