Enum skiff::ast::AstNode[][src]

pub enum AstNode {
Show 13 variants NumberNode(i64), BoolNode(bool), VarNode(String), LetNodeTopLevel(IdentifierBox<Ast>), LetNode(IdentifierBox<Ast>, Box<Ast>), IfNode(Vec<(Ast, Ast)>, Box<Ast>), BinOpNode(BinOpBox<Ast>, Box<Ast>), FunCallNode(Box<Ast>, Vec<Ast>), LambdaNode(Vec<Identifier>, Box<Ast>), FunctionNode(StringVec<Identifier>, Option<Type>, Box<Ast>), DataDeclarationNode(StringVec<(String, Vec<Identifier>)>), DataLiteralNode(DiscriminantVec<Box<Ast>>), MatchNode(Box<Ast>, Vec<(Pattern, Ast)>),
}

Variants

NumberNode(i64)

(val)

Tuple Fields of NumberNode

0: i64
BoolNode(bool)

(val)

Tuple Fields of BoolNode

0: bool
VarNode(String)

(val)

Tuple Fields of VarNode

0: String
LetNodeTopLevel(IdentifierBox<Ast>)

(id, expr)

Tuple Fields of LetNodeTopLevel

0: Identifier1: Box<Ast>
LetNode(IdentifierBox<Ast>, Box<Ast>)

(id, expr, body)

Tuple Fields of LetNode

0: Identifier1: Box<Ast>2: Box<Ast>
IfNode(Vec<(Ast, Ast)>, Box<Ast>)

(conditions_and_bodies, alternate)

Tuple Fields of IfNode

0: Vec<(Ast, Ast)>1: Box<Ast>
BinOpNode(BinOpBox<Ast>, Box<Ast>)

(operator, operand1, operand2)

Tuple Fields of BinOpNode

0: BinOp1: Box<Ast>2: Box<Ast>
FunCallNode(Box<Ast>, Vec<Ast>)

(fun_value, arg_list)

Tuple Fields of FunCallNode

0: Box<Ast>1: Vec<Ast>
LambdaNode(Vec<Identifier>, Box<Ast>)

(param_list, body)

Tuple Fields of LambdaNode

0: Vec<Identifier>1: Box<Ast>
FunctionNode(StringVec<Identifier>, Option<Type>, Box<Ast>)

(function_name, param_list, body)

Tuple Fields of FunctionNode

0: String1: Vec<Identifier>2: Option<Type>3: Box<Ast>
DataDeclarationNode(StringVec<(String, Vec<Identifier>)>)

(data_name, data_Variants)

Tuple Fields of DataDeclarationNode

0: String1: Vec<(String, Vec<Identifier>)>
DataLiteralNode(DiscriminantVec<Box<Ast>>)

(discriminant, values)

Tuple Fields of DataLiteralNode

0: Discriminant1: Vec<Box<Ast>>
MatchNode(Box<Ast>, Vec<(Pattern, Ast)>)

(expression_to_match, branches)

Tuple Fields of MatchNode

0: Box<Ast>1: Vec<(Pattern, Ast)>

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

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 ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. 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.