pub enum NodePattern {
Wildcard,
Binder(WithMetaData<String>),
Constructor(WithMetaData<NodeMetaIdentifier>, Vec<WithMetaData<NodeArgumentPattern>>),
}
Expand description
NodePattern represents a pattern node in the AST It can either be a Wildcard, Binder or Constructor
Variants§
Wildcard
Represents a wildcard pattern
Example: match x with | _ => "wildcard" end
Binder(WithMetaData<String>)
Represents a binder pattern
Example: match x with | a => "binder" end
Constructor(WithMetaData<NodeMetaIdentifier>, Vec<WithMetaData<NodeArgumentPattern>>)
Represents a constructor pattern
Example: match x with | Cons a b => "constructor" end
Trait Implementations§
Source§impl AstVisitor for NodePattern
impl AstVisitor for NodePattern
fn visit( &self, emitter: &mut dyn AstConverting, ) -> Result<TraversalResult, String>
Source§impl Clone for NodePattern
impl Clone for NodePattern
Source§fn clone(&self) -> NodePattern
fn clone(&self) -> NodePattern
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 NodePattern
impl Debug for NodePattern
Source§impl PartialEq for NodePattern
impl PartialEq for NodePattern
Source§impl PartialOrd for NodePattern
impl PartialOrd for NodePattern
impl Eq for NodePattern
impl StructuralPartialEq for NodePattern
Auto Trait Implementations§
impl Freeze for NodePattern
impl RefUnwindSafe for NodePattern
impl Send for NodePattern
impl Sync for NodePattern
impl Unpin for NodePattern
impl UnwindSafe for NodePattern
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