Enum glsl::syntax::Expr [] [src]

pub enum Expr {
    Variable(Identifier),
    IntConst(i32),
    UIntConst(u32),
    BoolConst(bool),
    FloatConst(f32),
    DoubleConst(f64),
    Unary(UnaryOpBox<Expr>),
    Binary(BinaryOpBox<Expr>, Box<Expr>),
    Ternary(Box<Expr>, Box<Expr>, Box<Expr>),
    Assignment(Box<Expr>, AssignmentOpBox<Expr>),
    Bracket(Box<Expr>, ArraySpecifier),
    FunCall(FunIdentifierVec<Expr>),
    Dot(Box<Expr>, Identifier),
    PostInc(Box<Expr>),
    PostDec(Box<Expr>),
    Comma(Box<Expr>, Box<Expr>),
}

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

A variable expression, using an identifier.

Integral constant expression.

Unsigned integral constant expression.

Boolean constant expression.

Single precision floating expression.

Double precision floating expression.

A unary expression, gathering a single expression and a unary operator.

A binary expression, gathering two expressions and a binary operator.

A ternary conditional expression, gathering three expressions.

An assignment is also an expression. Gathers an expression that defines what to assign to, an assignment operator and the value to associate with.

Add an array specifier to an expression.

A functional call. It has a function identifier and a list of expressions (arguments).

An expression associated with a field selection (struct).

Post-incrementation of an expression.

Post-decrementation of an expression.

An expression that contains several, separated with comma.

Trait Implementations

impl Clone for Expr
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Expr
[src]

Formats the value using the given formatter.

impl PartialEq for Expr
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.