Files
ValueScript/valuescript_compiler/src/ident.rs
2023-07-21 15:27:02 +10:00

21 lines
363 B
Rust

pub struct Ident {
pub sym: swc_atoms::JsWord,
pub span: swc_common::Span,
}
impl Ident {
pub fn from_swc_ident(ident: &swc_ecma_ast::Ident) -> Self {
Ident {
sym: ident.sym.clone(),
span: ident.span,
}
}
pub fn this(span: swc_common::Span) -> Self {
Ident {
sym: swc_atoms::JsWord::from("this"),
span,
}
}
}