pub enum ExprData {
Show 16 variants
Variable(Node<IdentifierData>),
IntConst(i32),
UIntConst(u32),
BoolConst(bool),
FloatConst(f32),
DoubleConst(f64),
Unary(Node<UnaryOpData>, Box<Node<ExprData>, Global>),
Binary(Node<BinaryOpData>, Box<Node<ExprData>, Global>, Box<Node<ExprData>, Global>),
Ternary(Box<Node<ExprData>, Global>, Box<Node<ExprData>, Global>, Box<Node<ExprData>, Global>),
Assignment(Box<Node<ExprData>, Global>, Node<AssignmentOpData>, Box<Node<ExprData>, Global>),
Bracket(Box<Node<ExprData>, Global>, Box<Node<ExprData>, Global>),
FunCall(Node<FunIdentifierData>, Vec<Node<ExprData>, Global>),
Dot(Box<Node<ExprData>, Global>, Node<IdentifierData>),
PostInc(Box<Node<ExprData>, Global>),
PostDec(Box<Node<ExprData>, Global>),
Comma(Box<Node<ExprData>, Global>, Box<Node<ExprData>, Global>),
}
Expand description
The most general form of an expression.
As you can see if you read the variant list, in GLSL, an assignment is an expression. This is a bit silly but think of an assignment as a statement first then an expression which evaluates to what the statement “returns”.
An expression is either an assignment or a list (comma) of assignments.
Variants
Variable(Node<IdentifierData>)
A variable expression, using an identifier.
IntConst(i32)
Integral constant expression.
UIntConst(u32)
Unsigned integral constant expression.
BoolConst(bool)
Boolean constant expression.
FloatConst(f32)
Single precision floating expression.
DoubleConst(f64)
Double precision floating expression.
Unary(Node<UnaryOpData>, Box<Node<ExprData>, Global>)
A unary expression, gathering a single expression and a unary operator.
Binary(Node<BinaryOpData>, Box<Node<ExprData>, Global>, Box<Node<ExprData>, Global>)
A binary expression, gathering two expressions and a binary operator.
Ternary(Box<Node<ExprData>, Global>, Box<Node<ExprData>, Global>, Box<Node<ExprData>, Global>)
A ternary conditional expression, gathering three expressions.
Assignment(Box<Node<ExprData>, Global>, Node<AssignmentOpData>, Box<Node<ExprData>, Global>)
An assignment is also an expression. Gathers an expression that defines what to assign to, an assignment operator and the value to associate with.
Bracket(Box<Node<ExprData>, Global>, Box<Node<ExprData>, Global>)
Add an array specifier to an expression.
FunCall(Node<FunIdentifierData>, Vec<Node<ExprData>, Global>)
A functional call. It has a function identifier and a list of expressions (arguments).
Dot(Box<Node<ExprData>, Global>, Node<IdentifierData>)
An expression associated with a field selection (struct).
PostInc(Box<Node<ExprData>, Global>)
Post-incrementation of an expression.
PostDec(Box<Node<ExprData>, Global>)
Post-decrementation of an expression.
Comma(Box<Node<ExprData>, Global>, Box<Node<ExprData>, Global>)
An expression that contains several, separated with comma.
Implementations
Trait Implementations
sourceimpl From<ExprData> for InitializerData
impl From<ExprData> for InitializerData
sourcefn from(e: ExprData) -> InitializerData
fn from(e: ExprData) -> InitializerData
Converts to this type from the input type.
sourceimpl NodeContent for ExprData
impl NodeContent for ExprData
sourcefn into_node<T>(self) -> Node<T> where
T: From<Self> + NodeContent,
fn into_node<T>(self) -> Node<T> where
T: From<Self> + NodeContent,
Convert the contents into a node
sourcefn spanned(self, start: LexerPosition, end: LexerPosition) -> Node<Self>
fn spanned(self, start: LexerPosition, end: LexerPosition) -> Node<Self>
Add span information to a syntax node
sourceimpl NodeContentDisplay for ExprData
impl NodeContentDisplay for ExprData
impl StructuralPartialEq for ExprData
Auto Trait Implementations
impl RefUnwindSafe for ExprData
impl Send for ExprData
impl Sync for ExprData
impl Unpin for ExprData
impl UnwindSafe for ExprData
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> NodeDisplay for T where
T: NodeContentDisplay,
impl<T> NodeDisplay for T where
T: NodeContentDisplay,
sourcefn display(&self) -> NodeDisplayWrapper<'_, T>
fn display(&self) -> NodeDisplayWrapper<'_, T>
Obtain a display wrapper for the current node