mirror of
https://github.com/swc-project/swc.git
synced 2024-12-26 23:27:56 +03:00
40 lines
697 B
Rust
40 lines
697 B
Rust
use swc_ecma_ast::VarDeclKind;
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
pub enum ScopeKind {
|
|
Block,
|
|
Fn,
|
|
}
|
|
|
|
impl Default for ScopeKind {
|
|
fn default() -> Self {
|
|
ScopeKind::Fn
|
|
}
|
|
}
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
pub enum IdentType {
|
|
Binding,
|
|
Ref,
|
|
Label,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
pub enum DeclKind {
|
|
Lexical,
|
|
Param,
|
|
Var,
|
|
Function,
|
|
/// don't actually get stored
|
|
Type,
|
|
}
|
|
|
|
impl From<VarDeclKind> for DeclKind {
|
|
fn from(kind: VarDeclKind) -> Self {
|
|
match kind {
|
|
VarDeclKind::Const | VarDeclKind::Let => Self::Lexical,
|
|
VarDeclKind::Var => Self::Var,
|
|
}
|
|
}
|
|
}
|