Ast

Enum Ast 

Source
pub enum Ast {
Show 15 variants NullLiteral, BooleanLiteral(bool), FloatLiteral(f64), IntegerLiteral(i64), IdentifierLiteral(String), StringLiteral(String), ListLiteral(Vec<AstMeta>), FunctionCall(Box<AstMeta>, Vec<AstMeta>), BinaryExpression(Opcode, Box<AstMeta>, Box<AstMeta>), IndexExpression(Vec<AstMeta>), BracketIndex(Box<AstMeta>), PositiveUnary(Box<AstMeta>), NegativeUnary(Box<AstMeta>), NotUnary(Box<AstMeta>), PreprocessorStatement(Box<AstMeta>, Vec<AstMeta>),
}
Expand description

A list of possible AST expressions.

Variants§

§

NullLiteral

§

BooleanLiteral(bool)

A boolean literal, either true or false.

§

FloatLiteral(f64)

A 64-bit floating point number literal.

§

IntegerLiteral(i64)

A 64-bit integer literal.

§

IdentifierLiteral(String)

An identifier literal.

§

StringLiteral(String)

A string literal.

§

ListLiteral(Vec<AstMeta>)

A literal array of items, such as [item1, 2, 3, true, false].

§

FunctionCall(Box<AstMeta>, Vec<AstMeta>)

A function call with the given arguments.

§

BinaryExpression(Opcode, Box<AstMeta>, Box<AstMeta>)

A binary expression with two operands.

1 + 1
§

IndexExpression(Vec<AstMeta>)

An expression made with an unlimited amount of indexes, for example, item1["item2"].item3[item4()]

§

BracketIndex(Box<AstMeta>)

An index for an IndexExpression that may contain something other than an identifier.

item1["BracketIndexHere"]
§

PositiveUnary(Box<AstMeta>)

This is caused by using the + operator at the start of an operand, such as +10.

§

NegativeUnary(Box<AstMeta>)

This is caused by using the - operator at the start of an operand, such as -10.

§

NotUnary(Box<AstMeta>)

Negates a logical expression, the ! operator. For example, (!1 == 1).

§

PreprocessorStatement(Box<AstMeta>, Vec<AstMeta>)

A preprocessor statement with a given name and arguments.

Trait Implementations§

Source§

impl Clone for Ast

Source§

fn clone(&self) -> Ast

Returns a duplicate 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 Ast

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Ast

§

impl RefUnwindSafe for Ast

§

impl Send for Ast

§

impl Sync for Ast

§

impl Unpin for Ast

§

impl UnwindSafe for Ast

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, 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.