Enum ASTNode

Source
pub enum ASTNode {
Show 56 variants Integer(i64), Float(f64), Bool(bool), String(String), Label(String), Name(String), Paren(Box<ASTNode>), Block(Vec<ASTNode>, Box<Option<ASTNode>>), EmptyStatement, Break, Goto(Box<ASTNode>), RetStat(Box<Option<ASTNode>>), Add(Box<ASTNode>, Box<ASTNode>), Sub(Box<ASTNode>, Box<ASTNode>), Mul(Box<ASTNode>, Box<ASTNode>), Div(Box<ASTNode>, Box<ASTNode>), Exp(Box<ASTNode>, Box<ASTNode>), FDiv(Box<ASTNode>, Box<ASTNode>), Mod(Box<ASTNode>, Box<ASTNode>), And(Box<ASTNode>, Box<ASTNode>), Or(Box<ASTNode>, Box<ASTNode>), Lt(Box<ASTNode>, Box<ASTNode>), Le(Box<ASTNode>, Box<ASTNode>), Gt(Box<ASTNode>, Box<ASTNode>), Ge(Box<ASTNode>, Box<ASTNode>), Eq(Box<ASTNode>, Box<ASTNode>), Ne(Box<ASTNode>, Box<ASTNode>), BitOr(Box<ASTNode>, Box<ASTNode>), BitAnd(Box<ASTNode>, Box<ASTNode>), BitXor(Box<ASTNode>, Box<ASTNode>), Rsh(Box<ASTNode>, Box<ASTNode>), Lsh(Box<ASTNode>, Box<ASTNode>), BinNot(Box<ASTNode>), Not(Box<ASTNode>), Len(Box<ASTNode>), UMin(Box<ASTNode>), Concat(Box<ASTNode>, Box<ASTNode>), PrefixExp(Box<ASTNode>), Nil, VarArg, TableConstructor(Box<Option<ASTNode>>), Function(Box<ASTNode>), FunctionBody(Box<Option<ASTNode>>, Box<ASTNode>), FunctionName(Box<ASTNode>, Option<Vec<ASTNode>>, Option<Box<ASTNode>>), NamedFunction(Box<ASTNode>, Box<ASTNode>), ExpList(Vec<ASTNode>), VarList(Vec<ASTNode>), NameList(Vec<ASTNode>), FieldList(Vec<ASTNode>), ParameterList(Box<Option<ASTNode>>, bool), FieldSingle(Box<ASTNode>), FieldAssign(Box<ASTNode>, Box<ASTNode>), Local(Box<ASTNode>), Var(Box<ASTNode>), VarPrefixed(Box<ASTNode>, Box<ASTNode>), VarListAccess(Box<ASTNode>, Box<ASTNode>),
}

Variants§

§

Integer(i64)

§

Float(f64)

§

Bool(bool)

§

String(String)

§

Label(String)

§

Name(String)

§

Paren(Box<ASTNode>)

§

Block(Vec<ASTNode>, Box<Option<ASTNode>>)

§

EmptyStatement

§

Break

§

Goto(Box<ASTNode>)

§

RetStat(Box<Option<ASTNode>>)

§

Add(Box<ASTNode>, Box<ASTNode>)

§

Sub(Box<ASTNode>, Box<ASTNode>)

§

Mul(Box<ASTNode>, Box<ASTNode>)

§

Div(Box<ASTNode>, Box<ASTNode>)

§

Exp(Box<ASTNode>, Box<ASTNode>)

§

FDiv(Box<ASTNode>, Box<ASTNode>)

§

Mod(Box<ASTNode>, Box<ASTNode>)

§

And(Box<ASTNode>, Box<ASTNode>)

§

Or(Box<ASTNode>, Box<ASTNode>)

§

Lt(Box<ASTNode>, Box<ASTNode>)

§

Le(Box<ASTNode>, Box<ASTNode>)

§

Gt(Box<ASTNode>, Box<ASTNode>)

§

Ge(Box<ASTNode>, Box<ASTNode>)

§

Eq(Box<ASTNode>, Box<ASTNode>)

§

Ne(Box<ASTNode>, Box<ASTNode>)

§

BitOr(Box<ASTNode>, Box<ASTNode>)

§

BitAnd(Box<ASTNode>, Box<ASTNode>)

§

BitXor(Box<ASTNode>, Box<ASTNode>)

§

Rsh(Box<ASTNode>, Box<ASTNode>)

§

Lsh(Box<ASTNode>, Box<ASTNode>)

§

BinNot(Box<ASTNode>)

§

Not(Box<ASTNode>)

§

Len(Box<ASTNode>)

§

UMin(Box<ASTNode>)

§

Concat(Box<ASTNode>, Box<ASTNode>)

§

PrefixExp(Box<ASTNode>)

Takes one of Var FunctionCall Exp

§

Nil

§

VarArg

§

TableConstructor(Box<Option<ASTNode>>)

§

Function(Box<ASTNode>)

Takes a FunctionBody

§

FunctionBody(Box<Option<ASTNode>>, Box<ASTNode>)

Takes a ParameterList and a Block

§

FunctionName(Box<ASTNode>, Option<Vec<ASTNode>>, Option<Box<ASTNode>>)

Has 3 parameters the example: log.ms:al would produce Name log Name ms Name al

§

NamedFunction(Box<ASTNode>, Box<ASTNode>)

Takes a Name and a FunctionBody

§

ExpList(Vec<ASTNode>)

§

VarList(Vec<ASTNode>)

§

NameList(Vec<ASTNode>)

§

FieldList(Vec<ASTNode>)

§

ParameterList(Box<Option<ASTNode>>, bool)

Takes a list of parameters and is vararg

§

FieldSingle(Box<ASTNode>)

Contains an expr

§

FieldAssign(Box<ASTNode>, Box<ASTNode>)

The first node may be an expr to be resolved or a Name The second node is the assigned expr

§

Local(Box<ASTNode>)

§

Var(Box<ASTNode>)

Takes a Name

§

VarPrefixed(Box<ASTNode>, Box<ASTNode>)

Takes a prefixexp and a exp

§

VarListAccess(Box<ASTNode>, Box<ASTNode>)

Takes a prefixexp and a Name

Trait Implementations§

Source§

impl Clone for ASTNode

Source§

fn clone(&self) -> ASTNode

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ASTNode

Source§

fn fmt(&self, format: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ASTNode

Source§

fn fmt(&self, format: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ASTNode

Source§

fn eq(&self, other: &ASTNode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ASTNode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.