[][src]Enum mamba::parse::ast::Node

pub enum Node {
    File {
        pure: bool,
        modules: Vec<AST>,
    },
    Import {
        import: Vec<AST>,
        _as: Vec<AST>,
    },
    FromImport {
        id: Box<AST>,
        import: Box<AST>,
    },
    Class {
        ty: Box<AST>,
        args: Vec<AST>,
        parents: Vec<AST>,
        body: Option<Box<AST>>,
    },
    Generic {
        id: Box<AST>,
        isa: Option<Box<AST>>,
    },
    Parent {
        ty: Box<AST>,
        args: Vec<AST>,
    },
    Script {
        statements: Vec<AST>,
    },
    Init,
    Reassign {
        left: Box<AST>,
        right: Box<AST>,
    },
    VariableDef {
        private: bool,
        mutable: bool,
        var: Box<AST>,
        ty: Option<Box<AST>>,
        expression: Option<Box<AST>>,
        forward: Vec<AST>,
    },
    FunDef {
        pure: bool,
        private: bool,
        id: Box<AST>,
        fun_args: Vec<AST>,
        ret_ty: Option<Box<AST>>,
        raises: Vec<AST>,
        body: Option<Box<AST>>,
    },
    AnonFun {
        args: Vec<AST>,
        body: Box<AST>,
    },
    Raises {
        expr_or_stmt: Box<AST>,
        errors: Vec<AST>,
    },
    Raise {
        error: Box<AST>,
    },
    Handle {
        expr_or_stmt: Box<AST>,
        cases: Vec<AST>,
    },
    With {
        resource: Box<AST>,
        alias: Option<(Box<AST>, bool, Option<Box<AST>>)>,
        expr: Box<AST>,
    },
    FunctionCall {
        name: Box<AST>,
        args: Vec<AST>,
    },
    PropertyCall {
        instance: Box<AST>,
        property: Box<AST>,
    },
    Id {
        lit: String,
    },
    ExpressionType {
        expr: Box<AST>,
        mutable: bool,
        ty: Option<Box<AST>>,
    },
    TypeDef {
        ty: Box<AST>,
        isa: Option<Box<AST>>,
        body: Option<Box<AST>>,
    },
    TypeAlias {
        ty: Box<AST>,
        isa: Box<AST>,
        conditions: Vec<AST>,
    },
    TypeTup {
        types: Vec<AST>,
    },
    TypeUnion {
        types: Vec<AST>,
    },
    Type {
        id: Box<AST>,
        generics: Vec<AST>,
    },
    TypeFun {
        args: Vec<AST>,
        ret_ty: Box<AST>,
    },
    Condition {
        cond: Box<AST>,
        el: Option<Box<AST>>,
    },
    FunArg {
        vararg: bool,
        mutable: bool,
        var: Box<AST>,
        ty: Option<Box<AST>>,
        default: Option<Box<AST>>,
    },
    _Self,
    AddOp,
    SubOp,
    SqrtOp,
    MulOp,
    FDivOp,
    DivOp,
    PowOp,
    ModOp,
    EqOp,
    LeOp,
    GeOp,
    Set {
        elements: Vec<AST>,
    },
    SetBuilder {
        item: Box<AST>,
        conditions: Vec<AST>,
    },
    List {
        elements: Vec<AST>,
    },
    ListBuilder {
        item: Box<AST>,
        conditions: Vec<AST>,
    },
    Tuple {
        elements: Vec<AST>,
    },
    Range {
        from: Box<AST>,
        to: Box<AST>,
        inclusive: bool,
        step: Option<Box<AST>>,
    },
    Block {
        statements: Vec<AST>,
    },
    Real {
        lit: String,
    },
    Int {
        lit: String,
    },
    ENum {
        num: String,
        exp: String,
    },
    Str {
        lit: String,
        expressions: Vec<AST>,
    },
    DocStr {
        lit: String,
    },
    Bool {
        lit: bool,
    },
    Add {
        left: Box<AST>,
        right: Box<AST>,
    },
    AddU {
        expr: Box<AST>,
    },
    Sub {
        left: Box<AST>,
        right: Box<AST>,
    },
    SubU {
        expr: Box<AST>,
    },
    Mul {
        left: Box<AST>,
        right: Box<AST>,
    },
    Div {
        left: Box<AST>,
        right: Box<AST>,
    },
    FDiv {
        left: Box<AST>,
        right: Box<AST>,
    },
    Mod {
        left: Box<AST>,
        right: Box<AST>,
    },
    Pow {
        left: Box<AST>,
        right: Box<AST>,
    },
    Sqrt {
        expr: Box<AST>,
    },
    BAnd {
        left: Box<AST>,
        right: Box<AST>,
    },
    BOr {
        left: Box<AST>,
        right: Box<AST>,
    },
    BXOr {
        left: Box<AST>,
        right: Box<AST>,
    },
    BOneCmpl {
        expr: Box<AST>,
    },
    BLShift {
        left: Box<AST>,
        right: Box<AST>,
    },
    BRShift {
        left: Box<AST>,
        right: Box<AST>,
    },
    Le {
        left: Box<AST>,
        right: Box<AST>,
    },
    Ge {
        left: Box<AST>,
        right: Box<AST>,
    },
    Leq {
        left: Box<AST>,
        right: Box<AST>,
    },
    Geq {
        left: Box<AST>,
        right: Box<AST>,
    },
    Is {
        left: Box<AST>,
        right: Box<AST>,
    },
    IsN {
        left: Box<AST>,
        right: Box<AST>,
    },
    Eq {
        left: Box<AST>,
        right: Box<AST>,
    },
    Neq {
        left: Box<AST>,
        right: Box<AST>,
    },
    IsA {
        left: Box<AST>,
        right: Box<AST>,
    },
    IsNA {
        left: Box<AST>,
        right: Box<AST>,
    },
    Not {
        expr: Box<AST>,
    },
    And {
        left: Box<AST>,
        right: Box<AST>,
    },
    Or {
        left: Box<AST>,
        right: Box<AST>,
    },
    IfElse {
        cond: Box<AST>,
        then: Box<AST>,
        el: Option<Box<AST>>,
    },
    Match {
        cond: Box<AST>,
        cases: Vec<AST>,
    },
    Case {
        cond: Box<AST>,
        body: Box<AST>,
    },
    For {
        expr: Box<AST>,
        col: Box<AST>,
        body: Box<AST>,
    },
    In {
        left: Box<AST>,
        right: Box<AST>,
    },
    Step {
        amount: Box<AST>,
    },
    While {
        cond: Box<AST>,
        body: Box<AST>,
    },
    Break,
    Continue,
    Return {
        expr: Box<AST>,
    },
    ReturnEmpty,
    Underscore,
    Undefined,
    Pass,
    Question {
        left: Box<AST>,
        right: Box<AST>,
    },
    QuestionOp {
        expr: Box<AST>,
    },
    Print {
        expr: Box<AST>,
    },
    Comment {
        comment: String,
    },
}

Variants

File

Fields of File

pure: boolmodules: Vec<AST>
Import

Fields of Import

import: Vec<AST>_as: Vec<AST>
FromImport

Fields of FromImport

id: Box<AST>import: Box<AST>
Class

Fields of Class

ty: Box<AST>args: Vec<AST>parents: Vec<AST>body: Option<Box<AST>>
Generic

Fields of Generic

id: Box<AST>isa: Option<Box<AST>>
Parent

Fields of Parent

ty: Box<AST>args: Vec<AST>
Script

Fields of Script

statements: Vec<AST>
Init
Reassign

Fields of Reassign

left: Box<AST>right: Box<AST>
VariableDef

Fields of VariableDef

private: boolmutable: boolvar: Box<AST>ty: Option<Box<AST>>expression: Option<Box<AST>>forward: Vec<AST>
FunDef

Fields of FunDef

pure: boolprivate: boolid: Box<AST>fun_args: Vec<AST>ret_ty: Option<Box<AST>>raises: Vec<AST>body: Option<Box<AST>>
AnonFun

Fields of AnonFun

args: Vec<AST>body: Box<AST>
Raises

Fields of Raises

expr_or_stmt: Box<AST>errors: Vec<AST>
Raise

Fields of Raise

error: Box<AST>
Handle

Fields of Handle

expr_or_stmt: Box<AST>cases: Vec<AST>
With

Fields of With

resource: Box<AST>alias: Option<(Box<AST>, bool, Option<Box<AST>>)>expr: Box<AST>
FunctionCall

Fields of FunctionCall

name: Box<AST>args: Vec<AST>
PropertyCall

Fields of PropertyCall

instance: Box<AST>property: Box<AST>
Id

Fields of Id

lit: String
ExpressionType

Fields of ExpressionType

expr: Box<AST>mutable: boolty: Option<Box<AST>>
TypeDef

Fields of TypeDef

ty: Box<AST>isa: Option<Box<AST>>body: Option<Box<AST>>
TypeAlias

Fields of TypeAlias

ty: Box<AST>isa: Box<AST>conditions: Vec<AST>
TypeTup

Fields of TypeTup

types: Vec<AST>
TypeUnion

Fields of TypeUnion

types: Vec<AST>
Type

Fields of Type

id: Box<AST>generics: Vec<AST>
TypeFun

Fields of TypeFun

args: Vec<AST>ret_ty: Box<AST>
Condition

Fields of Condition

cond: Box<AST>el: Option<Box<AST>>
FunArg

Fields of FunArg

vararg: boolmutable: boolvar: Box<AST>ty: Option<Box<AST>>default: Option<Box<AST>>
_Self
AddOp
SubOp
SqrtOp
MulOp
FDivOp
DivOp
PowOp
ModOp
EqOp
LeOp
GeOp
Set

Fields of Set

elements: Vec<AST>
SetBuilder

Fields of SetBuilder

item: Box<AST>conditions: Vec<AST>
List

Fields of List

elements: Vec<AST>
ListBuilder

Fields of ListBuilder

item: Box<AST>conditions: Vec<AST>
Tuple

Fields of Tuple

elements: Vec<AST>
Range

Fields of Range

from: Box<AST>to: Box<AST>inclusive: boolstep: Option<Box<AST>>
Block

Fields of Block

statements: Vec<AST>
Real

Fields of Real

lit: String
Int

Fields of Int

lit: String
ENum

Fields of ENum

num: Stringexp: String
Str

Fields of Str

lit: Stringexpressions: Vec<AST>
DocStr

Fields of DocStr

lit: String
Bool

Fields of Bool

lit: bool
Add

Fields of Add

left: Box<AST>right: Box<AST>
AddU

Fields of AddU

expr: Box<AST>
Sub

Fields of Sub

left: Box<AST>right: Box<AST>
SubU

Fields of SubU

expr: Box<AST>
Mul

Fields of Mul

left: Box<AST>right: Box<AST>
Div

Fields of Div

left: Box<AST>right: Box<AST>
FDiv

Fields of FDiv

left: Box<AST>right: Box<AST>
Mod

Fields of Mod

left: Box<AST>right: Box<AST>
Pow

Fields of Pow

left: Box<AST>right: Box<AST>
Sqrt

Fields of Sqrt

expr: Box<AST>
BAnd

Fields of BAnd

left: Box<AST>right: Box<AST>
BOr

Fields of BOr

left: Box<AST>right: Box<AST>
BXOr

Fields of BXOr

left: Box<AST>right: Box<AST>
BOneCmpl

Fields of BOneCmpl

expr: Box<AST>
BLShift

Fields of BLShift

left: Box<AST>right: Box<AST>
BRShift

Fields of BRShift

left: Box<AST>right: Box<AST>
Le

Fields of Le

left: Box<AST>right: Box<AST>
Ge

Fields of Ge

left: Box<AST>right: Box<AST>
Leq

Fields of Leq

left: Box<AST>right: Box<AST>
Geq

Fields of Geq

left: Box<AST>right: Box<AST>
Is

Fields of Is

left: Box<AST>right: Box<AST>
IsN

Fields of IsN

left: Box<AST>right: Box<AST>
Eq

Fields of Eq

left: Box<AST>right: Box<AST>
Neq

Fields of Neq

left: Box<AST>right: Box<AST>
IsA

Fields of IsA

left: Box<AST>right: Box<AST>
IsNA

Fields of IsNA

left: Box<AST>right: Box<AST>
Not

Fields of Not

expr: Box<AST>
And

Fields of And

left: Box<AST>right: Box<AST>
Or

Fields of Or

left: Box<AST>right: Box<AST>
IfElse

Fields of IfElse

cond: Box<AST>then: Box<AST>el: Option<Box<AST>>
Match

Fields of Match

cond: Box<AST>cases: Vec<AST>
Case

Fields of Case

cond: Box<AST>body: Box<AST>
For

Fields of For

expr: Box<AST>col: Box<AST>body: Box<AST>
In

Fields of In

left: Box<AST>right: Box<AST>
Step

Fields of Step

amount: Box<AST>
While

Fields of While

cond: Box<AST>body: Box<AST>
Break
Continue
Return

Fields of Return

expr: Box<AST>
ReturnEmpty
Underscore
Undefined
Pass
Question

Fields of Question

left: Box<AST>right: Box<AST>
QuestionOp

Fields of QuestionOp

expr: Box<AST>
Print

Fields of Print

expr: Box<AST>
Comment

Fields of Comment

comment: String

Methods

impl Node[src]

pub fn equal_structure(&self, other: &Node) -> bool[src]

pub fn trivially_expression(&self) -> bool[src]

True if node is an expression with certainty.

Trait Implementations

impl Clone for Node[src]

impl Debug for Node[src]

impl Display for Node[src]

impl Eq for Node[src]

impl Hash for Node[src]

impl PartialEq<Node> for Node[src]

impl StructuralEq for Node[src]

impl StructuralPartialEq for Node[src]

Auto Trait Implementations

impl RefUnwindSafe for Node

impl Send for Node

impl Sync for Node

impl Unpin for Node

impl UnwindSafe for Node

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> ToString for T where
    T: Display + ?Sized
[src]

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,