Skip to main content

ExpressionKind

Enum ExpressionKind 

Source
pub enum ExpressionKind<'ast> {
Show 21 variants Boolean(bool), Call { func: Expression<'ast>, type_args: &'ast [TypeOrPack<'ast>], args: &'ast [Expression<'ast>], self_call: bool, arg_location: Location, }, FunctionLiteral(&'ast Function<'ast>), Grouped(Expression<'ast>), Integer { value: i64, parse_result: ConstantNumberParseResult, }, Nil, Number { value: f64, parse_result: ConstantNumberParseResult, }, String { value: AstString<'ast>, quote_style: StringQuoteStyle, }, InterpString { strings: &'ast [AstString<'ast>], expressions: &'ast [Expression<'ast>], }, Table { items: &'ast [TableItem<'ast>], }, If { condition: Expression<'ast>, has_then: bool, then_expression: Expression<'ast>, has_else: bool, else_expression: Expression<'ast>, }, Varargs, IndexExpr { expr: Expression<'ast>, index: Expression<'ast>, }, IndexName { expr: Expression<'ast>, index: AstName<'ast>, index_location: Location, op_position: Position, op: IndexNameOp, }, TypeAssertion { expr: Expression<'ast>, annotation: Type<'ast>, }, Instantiate { expr: Expression<'ast>, type_args: &'ast [TypeOrPack<'ast>], }, Unary { op: UnaryOp, rhs: Expression<'ast>, }, Local { local: &'ast Local<'ast>, upvalue: bool, }, Global(AstName<'ast>), Binary { lhs: Expression<'ast>, op: BinaryOp, rhs: Expression<'ast>, }, Error { expressions: &'ast [Expression<'ast>], message_index: usize, },
}

Variants§

§

Boolean(bool)

§

Call

Fields

§func: Expression<'ast>
§type_args: &'ast [TypeOrPack<'ast>]
§args: &'ast [Expression<'ast>]
§self_call: bool
§arg_location: Location
§

FunctionLiteral(&'ast Function<'ast>)

§

Grouped(Expression<'ast>)

§

Integer

Fields

§value: i64
§

Nil

§

Number

Fields

§value: f64
§

String

Fields

§value: AstString<'ast>
§quote_style: StringQuoteStyle
§

InterpString

Fields

§strings: &'ast [AstString<'ast>]
§expressions: &'ast [Expression<'ast>]
§

Table

Fields

§items: &'ast [TableItem<'ast>]
§

If

Fields

§condition: Expression<'ast>
§has_then: bool
§then_expression: Expression<'ast>
§has_else: bool
§else_expression: Expression<'ast>
§

Varargs

§

IndexExpr

Fields

§expr: Expression<'ast>
§index: Expression<'ast>
§

IndexName

Fields

§expr: Expression<'ast>
§index: AstName<'ast>
§index_location: Location
§op_position: Position
§

TypeAssertion

Fields

§expr: Expression<'ast>
§annotation: Type<'ast>
§

Instantiate

Fields

§expr: Expression<'ast>
§type_args: &'ast [TypeOrPack<'ast>]
§

Unary

Fields

§rhs: Expression<'ast>
§

Local

Fields

§local: &'ast Local<'ast>
§upvalue: bool
§

Global(AstName<'ast>)

§

Binary

Fields

§lhs: Expression<'ast>
§rhs: Expression<'ast>
§

Error

Fields

§expressions: &'ast [Expression<'ast>]
§message_index: usize

Trait Implementations§

Source§

impl<'ast> Clone for ExpressionKind<'ast>

Source§

fn clone(&self) -> ExpressionKind<'ast>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'ast> Copy for ExpressionKind<'ast>

Source§

impl<'ast> Debug for ExpressionKind<'ast>

Source§

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

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

impl<'ast> PartialEq for ExpressionKind<'ast>

Source§

fn eq(&self, other: &ExpressionKind<'ast>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<'ast> StructuralPartialEq for ExpressionKind<'ast>

Auto Trait Implementations§

§

impl<'ast> !Send for ExpressionKind<'ast>

§

impl<'ast> !Sync for ExpressionKind<'ast>

§

impl<'ast> Freeze for ExpressionKind<'ast>

§

impl<'ast> RefUnwindSafe for ExpressionKind<'ast>

§

impl<'ast> Unpin for ExpressionKind<'ast>

§

impl<'ast> UnsafeUnpin for ExpressionKind<'ast>

§

impl<'ast> UnwindSafe for ExpressionKind<'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.