Enum darklua_core::nodes::Expression
source · pub enum Expression {
Show 16 variants
Binary(Box<BinaryExpression>),
Call(Box<FunctionCall>),
False(Option<Token>),
Field(Box<FieldExpression>),
Function(FunctionExpression),
Identifier(Identifier),
If(Box<IfExpression>),
Index(Box<IndexExpression>),
Nil(Option<Token>),
Number(NumberExpression),
Parenthese(Box<ParentheseExpression>),
String(StringExpression),
Table(TableExpression),
True(Option<Token>),
Unary(Box<UnaryExpression>),
VariableArguments(Option<Token>),
}
Variants§
Binary(Box<BinaryExpression>)
Call(Box<FunctionCall>)
False(Option<Token>)
Field(Box<FieldExpression>)
Function(FunctionExpression)
Identifier(Identifier)
If(Box<IfExpression>)
Index(Box<IndexExpression>)
Nil(Option<Token>)
Number(NumberExpression)
Parenthese(Box<ParentheseExpression>)
String(StringExpression)
Table(TableExpression)
True(Option<Token>)
Unary(Box<UnaryExpression>)
VariableArguments(Option<Token>)
Implementations§
source§impl Expression
impl Expression
pub fn nil() -> Self
pub fn variable_arguments() -> Self
pub fn identifier<S: Into<Identifier>>(identifier: S) -> Self
pub fn in_parentheses(self) -> Self
Trait Implementations§
source§impl Clone for Expression
impl Clone for Expression
source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Expression
impl Debug for Expression
source§impl From<BinaryExpression> for Expression
impl From<BinaryExpression> for Expression
source§fn from(binary: BinaryExpression) -> Expression
fn from(binary: BinaryExpression) -> Expression
Converts to this type from the input type.
source§impl From<BinaryNumber> for Expression
impl From<BinaryNumber> for Expression
source§fn from(number: BinaryNumber) -> Self
fn from(number: BinaryNumber) -> Self
Converts to this type from the input type.
source§impl From<DecimalNumber> for Expression
impl From<DecimalNumber> for Expression
source§fn from(number: DecimalNumber) -> Self
fn from(number: DecimalNumber) -> Self
Converts to this type from the input type.
source§impl From<Expression> for Prefix
impl From<Expression> for Prefix
source§fn from(expression: Expression) -> Self
fn from(expression: Expression) -> Self
Converts to this type from the input type.
source§impl From<FieldExpression> for Expression
impl From<FieldExpression> for Expression
source§fn from(field: FieldExpression) -> Expression
fn from(field: FieldExpression) -> Expression
Converts to this type from the input type.
source§impl From<FunctionCall> for Expression
impl From<FunctionCall> for Expression
source§fn from(call: FunctionCall) -> Expression
fn from(call: FunctionCall) -> Expression
Converts to this type from the input type.
source§impl From<FunctionExpression> for Expression
impl From<FunctionExpression> for Expression
source§fn from(function: FunctionExpression) -> Self
fn from(function: FunctionExpression) -> Self
Converts to this type from the input type.
source§impl From<HexNumber> for Expression
impl From<HexNumber> for Expression
source§impl From<Identifier> for Expression
impl From<Identifier> for Expression
source§fn from(identifier: Identifier) -> Self
fn from(identifier: Identifier) -> Self
Converts to this type from the input type.
source§impl From<IfExpression> for Expression
impl From<IfExpression> for Expression
source§fn from(if_expression: IfExpression) -> Expression
fn from(if_expression: IfExpression) -> Expression
Converts to this type from the input type.
source§impl From<IndexExpression> for Expression
impl From<IndexExpression> for Expression
source§fn from(index: IndexExpression) -> Self
fn from(index: IndexExpression) -> Self
Converts to this type from the input type.
source§impl From<NumberExpression> for Expression
impl From<NumberExpression> for Expression
source§fn from(number: NumberExpression) -> Self
fn from(number: NumberExpression) -> Self
Converts to this type from the input type.
source§impl From<ParentheseExpression> for Expression
impl From<ParentheseExpression> for Expression
source§fn from(expression: ParentheseExpression) -> Self
fn from(expression: ParentheseExpression) -> Self
Converts to this type from the input type.
source§impl From<Prefix> for Expression
impl From<Prefix> for Expression
source§impl From<StringExpression> for Expression
impl From<StringExpression> for Expression
source§fn from(string: StringExpression) -> Self
fn from(string: StringExpression) -> Self
Converts to this type from the input type.
source§impl From<TableExpression> for Expression
impl From<TableExpression> for Expression
source§fn from(table: TableExpression) -> Self
fn from(table: TableExpression) -> Self
Converts to this type from the input type.
source§impl From<UnaryExpression> for Expression
impl From<UnaryExpression> for Expression
source§fn from(unary: UnaryExpression) -> Self
fn from(unary: UnaryExpression) -> Self
Converts to this type from the input type.
source§impl From<Variable> for Expression
impl From<Variable> for Expression
source§impl From<bool> for Expression
impl From<bool> for Expression
source§fn from(boolean: bool) -> Expression
fn from(boolean: bool) -> Expression
Converts to this type from the input type.
source§impl From<f32> for Expression
impl From<f32> for Expression
source§impl From<f64> for Expression
impl From<f64> for Expression
source§fn from(value: f64) -> Expression
fn from(value: f64) -> Expression
Converts to this type from the input type.
source§impl From<i16> for Expression
impl From<i16> for Expression
source§impl From<i32> for Expression
impl From<i32> for Expression
source§impl From<i64> for Expression
impl From<i64> for Expression
source§impl From<i8> for Expression
impl From<i8> for Expression
source§impl From<u16> for Expression
impl From<u16> for Expression
source§impl From<u32> for Expression
impl From<u32> for Expression
source§impl From<u64> for Expression
impl From<u64> for Expression
source§impl From<u8> for Expression
impl From<u8> for Expression
source§impl From<usize> for Expression
impl From<usize> for Expression
source§impl PartialEq<Expression> for Expression
impl PartialEq<Expression> for Expression
source§fn eq(&self, other: &Expression) -> bool
fn eq(&self, other: &Expression) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for Expression
impl StructuralEq for Expression
impl StructuralPartialEq for Expression
Auto Trait Implementations§
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original
input to the nom parser, extract more the useful context information. Read more
§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
§fn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom,
recreate a context in the original string where the error occurred. Read more