pub enum GLSLExpr {
Literal(String),
Var(String),
BinOp {
op: String,
lhs: Box<GLSLExpr>,
rhs: Box<GLSLExpr>,
},
UnaryOp {
op: String,
operand: Box<GLSLExpr>,
},
Call {
func: String,
args: Vec<GLSLExpr>,
},
Field {
base: Box<GLSLExpr>,
field: String,
},
Index {
base: Box<GLSLExpr>,
index: Box<GLSLExpr>,
},
Ternary {
cond: Box<GLSLExpr>,
then_expr: Box<GLSLExpr>,
else_expr: Box<GLSLExpr>,
},
}Expand description
A simple GLSL expression, sufficient for code-generation purposes.
Variants§
Literal(String)
A literal number or boolean token.
Var(String)
A variable reference.
BinOp
A binary infix operation.
UnaryOp
A unary prefix operation.
Call
A function/constructor call.
Field
A field access (e.g. v.xy).
Index
An array index access.
Ternary
A ternary cond ? then : else expression.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GLSLExpr
impl RefUnwindSafe for GLSLExpr
impl Send for GLSLExpr
impl Sync for GLSLExpr
impl Unpin for GLSLExpr
impl UnsafeUnpin for GLSLExpr
impl UnwindSafe for GLSLExpr
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