swc_ecma_lexer/common/parser/pat_type.rs
1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
2pub(super) enum PatType {
3 BindingPat,
4 BindingElement,
5 /// AssignmentPattern
6 AssignPat,
7 AssignElement,
8}
9
10impl PatType {
11 pub fn element(self) -> Self {
12 match self {
13 PatType::BindingPat | PatType::BindingElement => PatType::BindingElement,
14 PatType::AssignPat | PatType::AssignElement => PatType::AssignElement,
15 }
16 }
17}