Enum passerine::compiler::ast::ASTPattern[][src]

pub enum ASTPattern {
    Symbol(String),
    Data(Data),
    Chain(Vec<Spanned<ASTPattern>>),
    Label(StringBox<Spanned<ASTPattern>>),
    Tuple(Vec<Spanned<ASTPattern>>),
}

Represents a Pattern during the AST phase of compilation. A pattern is like a very general type, because Passerine uses structural row-based typing.

Variants

Symbol(String)
Data(Data)

Implementations

impl ASTPattern[src]

pub fn label(name: String, pattern: Spanned<ASTPattern>) -> ASTPattern[src]

Trait Implementations

impl Clone for ASTPattern[src]

impl Debug for ASTPattern[src]

impl PartialEq<ASTPattern> for ASTPattern[src]

impl StructuralPartialEq for ASTPattern[src]

impl TryFrom<AST> for ASTPattern[src]

type Error = String

The type returned in the event of a conversion error.

fn try_from(ast: AST) -> Result<Self, Self::Error>[src]

Tries to convert an AST into a Pattern. Patterns mirror the ASTs they are designed to destructure. During parsing, they are just parsed as ASTs - When the compiler can determine that an AST is actually a pattern, It performs this conversion.

impl TryFrom<ASTPattern> for CSTPattern[src]

type Error = String

The type returned in the event of a conversion error.

fn try_from(ast_pattern: ASTPattern) -> Result<Self, Self::Error>[src]

Directly maps ASTPatterns to CSTPatterns. This function may become a bit more complex once 'where' is added.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.