Skip to content

Commit

Permalink
style: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
DonIsaac committed Jul 23, 2024
1 parent 85a7cea commit 2e32df2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions crates/oxc_syntax/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ impl SymbolFlags {
self.intersects(Self::Variable)
}

pub fn is_type_parameter(&self) -> bool {
self.contains(Self::TypeParameter)
}

/// If true, then the symbol is a type, such as a TypeAlias, Interface, or Enum
pub fn is_type(&self) -> bool {
self.intersects((Self::TypeImport | Self::Type) - Self::Value)
Expand All @@ -116,6 +120,18 @@ impl SymbolFlags {
self.contains(Self::Class)
}

pub fn is_interface(&self) -> bool {
self.contains(Self::Interface)
}

pub fn is_type_alias(&self) -> bool {
self.contains(Self::TypeAlias)
}

pub fn is_enum(&self) -> bool {
self.intersects(Self::Enum)
}

pub fn is_catch_variable(&self) -> bool {
self.contains(Self::CatchVariable)
}
Expand All @@ -132,6 +148,10 @@ impl SymbolFlags {
self.intersects(Self::Import | Self::TypeImport)
}

pub fn is_type_import(&self) -> bool {
self.contains(Self::TypeImport)
}

/// If true, then the symbol can be referenced by a type
pub fn can_be_referenced_by_type(&self) -> bool {
self.intersects(Self::Type | Self::TypeImport | Self::Import)
Expand Down

0 comments on commit 2e32df2

Please sign in to comment.