Enum mamba::parse::ast::Node

source ·
pub enum Node {
Show 84 variants Import { from: Option<Box<AST>>, import: Vec<AST>, alias: Vec<AST>, }, Class { ty: Box<AST>, args: Vec<AST>, parents: Vec<AST>, body: OptAST, }, Generic { id: Box<AST>, isa: OptAST, }, Parent { ty: Box<AST>, args: Vec<AST>, }, Reassign { left: Box<AST>, right: Box<AST>, op: NodeOp, }, VariableDef { mutable: bool, var: Box<AST>, ty: OptAST, expr: OptAST, forward: Vec<AST>, }, FunDef { pure: bool, id: Box<AST>, args: Vec<AST>, ret: OptAST, raises: Vec<AST>, body: OptAST, }, AnonFun { args: Vec<AST>, body: Box<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: OptAST, }, TypeDef { ty: Box<AST>, isa: OptAST, body: OptAST, }, 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: OptAST, }, FunArg { vararg: bool, mutable: bool, var: Box<AST>, ty: OptAST, default: OptAST, }, Dict { elements: Vec<(AST, AST)>, }, DictBuilder { from: Box<AST>, to: Box<AST>, conditions: Vec<AST>, }, 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: OptAST, }, Slice { from: Box<AST>, to: Box<AST>, inclusive: bool, step: OptAST, }, Index { item: Box<AST>, range: 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: OptAST, }, 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>, }, 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>, },
}

Variants§

§

Import

Fields

§from: Option<Box<AST>>
§import: Vec<AST>
§alias: Vec<AST>
§

Class

Fields

§ty: Box<AST>
§args: Vec<AST>
§parents: Vec<AST>
§body: OptAST
§

Generic

Fields

§id: Box<AST>
§isa: OptAST
§

Parent

Fields

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

Reassign

Fields

§left: Box<AST>
§right: Box<AST>
§

VariableDef

Fields

§mutable: bool
§var: Box<AST>
§expr: OptAST
§forward: Vec<AST>
§

FunDef

Fields

§pure: bool
§id: Box<AST>
§args: Vec<AST>
§ret: OptAST
§raises: Vec<AST>
§body: OptAST
§

AnonFun

Fields

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

Raise

Fields

§error: Box<AST>
§

Handle

Fields

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

With

Fields

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

FunctionCall

Fields

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

PropertyCall

Fields

§instance: Box<AST>
§property: Box<AST>
§

Id

Fields

§lit: String
§

ExpressionType

Fields

§expr: Box<AST>
§mutable: bool
§

TypeDef

Fields

§ty: Box<AST>
§isa: OptAST
§body: OptAST
§

TypeAlias

Fields

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

TypeTup

Fields

§types: Vec<AST>
§

TypeUnion

Fields

§types: Vec<AST>
§

Type

Fields

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

TypeFun

Fields

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

Condition

Fields

§cond: Box<AST>
§

FunArg

Fields

§vararg: bool
§mutable: bool
§var: Box<AST>
§default: OptAST
§

Dict

Fields

§elements: Vec<(AST, AST)>
§

DictBuilder

Fields

§from: Box<AST>
§to: Box<AST>
§conditions: Vec<AST>
§

Set

Fields

§elements: Vec<AST>
§

SetBuilder

Fields

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

List

Fields

§elements: Vec<AST>
§

ListBuilder

Fields

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

Tuple

Fields

§elements: Vec<AST>
§

Range

Fields

§from: Box<AST>
§to: Box<AST>
§inclusive: bool
§step: OptAST
§

Slice

Fields

§from: Box<AST>
§to: Box<AST>
§inclusive: bool
§step: OptAST
§

Index

Fields

§item: Box<AST>
§range: Box<AST>
§

Block

Fields

§statements: Vec<AST>
§

Real

Fields

§lit: String
§

Int

Fields

§lit: String
§

ENum

Fields

§num: String
§exp: String
§

Str

Fields

§lit: String
§expressions: Vec<AST>
§

DocStr

Fields

§lit: String
§

Bool

Fields

§lit: bool
§

Add

Fields

§left: Box<AST>
§right: Box<AST>
§

AddU

Fields

§expr: Box<AST>
§

Sub

Fields

§left: Box<AST>
§right: Box<AST>
§

SubU

Fields

§expr: Box<AST>
§

Mul

Fields

§left: Box<AST>
§right: Box<AST>
§

Div

Fields

§left: Box<AST>
§right: Box<AST>
§

FDiv

Fields

§left: Box<AST>
§right: Box<AST>
§

Mod

Fields

§left: Box<AST>
§right: Box<AST>
§

Pow

Fields

§left: Box<AST>
§right: Box<AST>
§

Sqrt

Fields

§expr: Box<AST>
§

BAnd

Fields

§left: Box<AST>
§right: Box<AST>
§

BOr

Fields

§left: Box<AST>
§right: Box<AST>
§

BXOr

Fields

§left: Box<AST>
§right: Box<AST>
§

BOneCmpl

Fields

§expr: Box<AST>
§

BLShift

Fields

§left: Box<AST>
§right: Box<AST>
§

BRShift

Fields

§left: Box<AST>
§right: Box<AST>
§

Le

Fields

§left: Box<AST>
§right: Box<AST>
§

Ge

Fields

§left: Box<AST>
§right: Box<AST>
§

Leq

Fields

§left: Box<AST>
§right: Box<AST>
§

Geq

Fields

§left: Box<AST>
§right: Box<AST>
§

Is

Fields

§left: Box<AST>
§right: Box<AST>
§

IsN

Fields

§left: Box<AST>
§right: Box<AST>
§

Eq

Fields

§left: Box<AST>
§right: Box<AST>
§

Neq

Fields

§left: Box<AST>
§right: Box<AST>
§

IsA

Fields

§left: Box<AST>
§right: Box<AST>
§

IsNA

Fields

§left: Box<AST>
§right: Box<AST>
§

Not

Fields

§expr: Box<AST>
§

And

Fields

§left: Box<AST>
§right: Box<AST>
§

Or

Fields

§left: Box<AST>
§right: Box<AST>
§

IfElse

Fields

§cond: Box<AST>
§then: Box<AST>
§

Match

Fields

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

Case

Fields

§cond: Box<AST>
§body: Box<AST>
§

For

Fields

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

In

Fields

§left: Box<AST>
§right: Box<AST>
§

While

Fields

§cond: Box<AST>
§body: Box<AST>
§

Break

§

Continue

§

Return

Fields

§expr: Box<AST>
§

ReturnEmpty

§

Underscore

§

Undefined

§

Pass

§

Question

Fields

§left: Box<AST>
§right: Box<AST>
§

QuestionOp

Fields

§expr: Box<AST>

Implementations§

Apply mapping to node, before recursively applying mapping to result

True if node is an expression with certainty.

If False, then it might still be an expression if for instance it is a function call. In such a case, the type checker must determine if it is an expression.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.