pub enum Expr {
Show 14 variants
Num(f64),
Str(StringExpr),
Index(Vec<Expr>),
Var(String, Option<Box<Expr>>),
Env(EnvVar),
Unary(UnOp, Box<Expr>),
Bin(BinOp, Box<Expr>, Box<Expr>),
Func1(Func1, Box<Expr>),
Func2(Func2, Box<Expr>, Box<Expr>),
Rand(Option<Box<Expr>>),
Assign(String, Option<Box<Expr>>, Box<Expr>),
DotX(Location),
DotY(Location),
PlaceAttr(Place, Param),
}Expand description
A scalar (numeric / boolean) expression. pic treats booleans as numbers.
Variants§
Num(f64)
Str(StringExpr)
A string operand, valid only as an operand of ==/!= (pic compares
strings for equality, e.g. the "$1"=="" default-argument idiom).
Index(Vec<Expr>)
Comma-separated array subscript, valid only inside name[...].
Var(String, Option<Box<Expr>>)
Env(EnvVar)
Unary(UnOp, Box<Expr>)
Bin(BinOp, Box<Expr>, Box<Expr>)
Func1(Func1, Box<Expr>)
Func2(Func2, Box<Expr>, Box<Expr>)
Rand(Option<Box<Expr>>)
Assign(String, Option<Box<Expr>>, Box<Expr>)
( name = expr ) — assign and yield the assigned value.
DotX(Location)
DotY(Location)
PlaceAttr(Place, Param)
Trait Implementations§
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
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