Enum glsl_lang::ast::Expr [−][src]
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(Identifier)
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.
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.
Assignment(Box<Expr>, AssignmentOp, Box<Expr>)
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.
FunCall(FunIdentifier, Vec<Expr>)
A functional call. It has a function identifier and a list of expressions (arguments).
Dot(Box<Expr>, Identifier)
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.
Implementations
impl Expr
[src]
pub fn variable(name: impl Into<IdentifierData>) -> Self
[src]
Construct an Expr::Variable(name)
from an identifier name
pub fn as_rs_ident(&self) -> Option<&str>
[src]
Try to parse this function identifier as a glsl-lang-quote
Rust identifier
Trait Implementations
impl Clone for Expr
[src]
impl Debug for Expr
[src]
impl From<Expr> for Initializer
[src]
impl From<bool> for Expr
[src]
impl From<f32> for Expr
[src]
impl From<f64> for Expr
[src]
impl From<i32> for Expr
[src]
impl From<u32> for Expr
[src]
impl Host for Expr
[src]
impl HostMut for Expr
[src]
fn visit_mut<V>(&mut self, visitor: &mut V) where
V: VisitorMut,
[src]
V: VisitorMut,
impl NodeContent for Expr
[src]
pub fn into_node<T>(self) -> Node<T> where
T: From<Self> + NodeContent,
[src]
T: From<Self> + NodeContent,
pub fn spanned(self, start: LexerPosition, end: LexerPosition) -> Node<Self>
[src]
impl NodeContentDisplay for Expr
[src]
fn name() -> Option<&'static str>
[src]
fn display_extra(&self, f: &mut Formatter<'_>) -> Result
[src]
fn display_children(&self, level: usize, f: &mut Formatter<'_>) -> Result
[src]
impl NodeContentEq for Expr
[src]
fn content_eq(&self, other: &Self) -> bool
[src]
impl Parsable for Expr
[src]
fn parse_with_options(
source: &str,
opts: &ParseContext
) -> Result<(Self, ParseContext), ParseError>
[src]
source: &str,
opts: &ParseContext
) -> Result<(Self, ParseContext), ParseError>
fn parse(source: &str) -> Result<Self, ParseError>
[src]
impl PartialEq<Expr> for Expr
[src]
impl StructuralPartialEq for Expr
[src]
Auto Trait Implementations
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnwindSafe for Expr
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoResult<T> for T
[src]
type Err = Infallible
pub fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
[src]
impl<T> NodeDisplay for T where
T: NodeContentDisplay,
[src]
T: NodeContentDisplay,
pub fn name() -> Option<&'static str>
[src]
pub fn start(&self) -> Option<usize>
[src]
pub fn end(&self) -> Option<usize>
[src]
pub fn source_id(&self) -> Option<usize>
[src]
pub fn display(&self) -> NodeDisplayWrapper<'_, T>
[src]
pub fn display_extra(&self, f: &mut Formatter<'_>) -> Result<(), Error>
[src]
pub fn display_children(
&self,
level: usize,
f: &mut Formatter<'_>
) -> Result<(), Error>
[src]
&self,
level: usize,
f: &mut Formatter<'_>
) -> Result<(), Error>
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,