Enum muse_lang::compiler::syntax::PatternKind
source · pub enum PatternKind {
Any(Option<Symbol>),
AnyRemaining,
Compare(PatternComparison),
Literal(Literal),
DestructureTuple(Box<Enclosed<Delimited<Ranged<PatternKind>>>>),
DestructureMap(Box<Enclosed<Delimited<Ranged<EntryPattern>>>>),
Or(Box<Ranged<PatternKind>>, Ranged<Token>, Box<Ranged<PatternKind>>),
}Expand description
The syntax components of a portion of a pattern match.
Variants§
Any(Option<Symbol>)
Match any single expression, optionally assigning it a name.
AnyRemaining
Match any remaining expressions.
Compare(PatternComparison)
A comparison pattern.
Literal(Literal)
Match a literal value.
DestructureTuple(Box<Enclosed<Delimited<Ranged<PatternKind>>>>)
Match by destructuring the value as a tuple.
DestructureMap(Box<Enclosed<Delimited<Ranged<EntryPattern>>>>)
Match by destructuring the value as a map.
Or(Box<Ranged<PatternKind>>, Ranged<Token>, Box<Ranged<PatternKind>>)
Match by either one pattern or another pattern.
Trait Implementations§
source§impl Clone for PatternKind
impl Clone for PatternKind
source§fn clone(&self) -> PatternKind
fn clone(&self) -> PatternKind
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for PatternKind
impl Debug for PatternKind
source§impl PartialEq for PatternKind
impl PartialEq for PatternKind
source§impl TokenizeRanged for PatternKind
impl TokenizeRanged for PatternKind
source§fn tokenize_ranged(
&self,
range: SourceRange,
tokens: &mut VecDeque<Ranged<Token>>,
)
fn tokenize_ranged( &self, range: SourceRange, tokens: &mut VecDeque<Ranged<Token>>, )
Tokenize
self into tokens within the enclosing range.impl StructuralPartialEq for PatternKind
Auto Trait Implementations§
impl Freeze for PatternKind
impl RefUnwindSafe for PatternKind
impl Send for PatternKind
impl Sync for PatternKind
impl Unpin for PatternKind
impl UnwindSafe for PatternKind
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<A> Cast for A
impl<A> Cast for A
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)