Enum scilla_parser::ast::nodes::NodePattern
source · 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§fn eq(&self, other: &NodePattern) -> bool
fn eq(&self, other: &NodePattern) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for NodePattern
impl PartialOrd for NodePattern
source§fn partial_cmp(&self, other: &NodePattern) -> Option<Ordering>
fn partial_cmp(&self, other: &NodePattern) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for NodePattern
impl StructuralEq for NodePattern
impl StructuralPartialEq for NodePattern
Auto Trait Implementations§
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