Enum passerine::compiler::ast::ASTPattern [−][src]
pub enum ASTPattern {
Symbol(String),
Data(Data),
Chain(Vec<Spanned<ASTPattern>>),
Label(String, Box<Spanned<ASTPattern>>),
Tuple(Vec<Spanned<ASTPattern>>),
}
Expand description
Represents a CSTPattern during the AST phase of compilation. A pattern is like a very general type, because Passerine uses structural row-based typing.
Variants
Symbol(String)
Tuple Fields of Symbol
0: String
Data(Data)
Tuple Fields of Data
0: Data
Chain(Vec<Spanned<ASTPattern>>)
Tuple Fields of Chain
0: Vec<Spanned<ASTPattern>>
Label(String, Box<Spanned<ASTPattern>>)
Tuple Fields of Label
0: String
1: Box<Spanned<ASTPattern>>
Tuple(Vec<Spanned<ASTPattern>>)
Tuple Fields of Tuple
0: Vec<Spanned<ASTPattern>>
Implementations
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Tries to convert an AST
into a CSTPattern
.
CSTPatterns mirror the AST
s they are designed to destructure.
During parsing, they are just parsed as AST
s -
When the compiler can determine that an AST is actually a pattern,
It performs this conversion.
Auto Trait Implementations
impl !RefUnwindSafe for ASTPattern
impl !Send for ASTPattern
impl !Sync for ASTPattern
impl Unpin for ASTPattern
impl !UnwindSafe for ASTPattern
Blanket Implementations
Mutably borrows from an owned value. Read more