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

pub enum Node {
    StatementList(Vec<Node>),
    IfStatement(Box<Node>, Box<Node>, Option<Box<Node>>),
    RepeatStatement(Box<Node>, Box<Node>),
    WhileStatement(Box<Node>, Box<Node>),
    LearnStatement(String, Vec<String>, Box<Node>),
    TryStatement(Box<Node>, Box<Node>),
    Comparison(Box<Node>, CompOp, Box<Node>),
    Addition(Box<Node>, Vec<(AddOp, Node)>),
    Multiplication(Box<Node>, Vec<(MulOp, Node)>),
    FuncCall(String, Vec<Node>),
    ReturnStatement(Box<Node>),
    List(Vec<Node>),
    StringLiteral(String),
    Number(f32),
    Variable(String),
}

Variants

StatementList

A list of statements as found inside a loop body

IfStatement

The if conditional (expression, true-clause, maybe false-clause)

RepeatStatement

The repeat statement (count, loop body)

WhileStatement

The while statement (condition, loop body)

LearnStatement

The function definition statement (func name, func arg names, func body)

TryStatement

A block that ignores errors, the first element is the "ordinary" block, the second element is the block that will be called when an exception occurs

Comparison
Addition

Addition or subtraction. One addition may hold more than one operation.

Multiplication

Multiplication and division. One multiplication may hole more than one operation.

FuncCall

A function call (function, arguments)

ReturnStatement
List
StringLiteral
Number
Variable

Methods

impl Node

fn flatten(self) -> Node

Consume the node and produce a flat version

Trait Implementations

Derived Implementations

impl Clone for Node

fn clone(&self) -> Node

fn clone_from(&mut self, source: &Self)

impl Debug for Node

fn fmt(&self, __arg_0: &mut Formatter) -> Result