pub enum Expr<'input> {
Show 23 variants
None(None),
Bool(Bool<'input>),
Num(Num<'input>),
Ident(Ident<'input>),
Atom(Atom<'input>),
Str(Str<'input>),
Binary(Binary<'input>),
Call(Call<'input>),
Unary(Unary<'input>),
Assign(Assign<'input>),
If(If<'input>),
InlineFun(InlineFun<'input>),
Fun(Fun<'input>),
Block(Block<'input>),
ListLit(ListLit<'input>),
MapLit(MapLit<'input>),
Struct(Struct<'input>),
Var(Var<'input>),
While(While<'input>),
Break(Break<'input>),
Continue(Continue<'input>),
Return(Return<'input>),
Range(Range<'input>),
}
Expand description
An xlang expression.
Variants§
None(None)
Bool(Bool<'input>)
Num(Num<'input>)
Ident(Ident<'input>)
Atom(Atom<'input>)
Str(Str<'input>)
Binary(Binary<'input>)
Call(Call<'input>)
Unary(Unary<'input>)
Assign(Assign<'input>)
If(If<'input>)
InlineFun(InlineFun<'input>)
Fun(Fun<'input>)
Block(Block<'input>)
ListLit(ListLit<'input>)
MapLit(MapLit<'input>)
Struct(Struct<'input>)
Var(Var<'input>)
While(While<'input>)
Break(Break<'input>)
Continue(Continue<'input>)
Return(Return<'input>)
Range(Range<'input>)
Implementations§
Source§impl<'input> Expr<'input>
impl<'input> Expr<'input>
Sourcepub fn float(loc: Loc, value: &'input str) -> Self
pub fn float(loc: Loc, value: &'input str) -> Self
Creates a new floating point number expression.
Sourcepub fn binary(loc: Loc, left: Self, op: BinaryOp, right: Self) -> Self
pub fn binary(loc: Loc, left: Self, op: BinaryOp, right: Self) -> Self
Creates a new binary operation.
Sourcepub fn call(loc: Loc, fun: Self, args: Vec<Self>) -> Self
pub fn call(loc: Loc, fun: Self, args: Vec<Self>) -> Self
Creates a new function call operation.
Sourcepub fn unary(loc: Loc, op: UnaryOp, subject: Self) -> Self
pub fn unary(loc: Loc, op: UnaryOp, subject: Self) -> Self
Creates a new function call operation.
Sourcepub fn assign(loc: Loc, left: Self, op: AssignOp, right: Self) -> Self
pub fn assign(loc: Loc, left: Self, op: AssignOp, right: Self) -> Self
Creates a new assignment operation.
Sourcepub fn range_exclusive(
loc: Loc,
left: Option<Self>,
right: Option<Self>,
) -> Self
pub fn range_exclusive( loc: Loc, left: Option<Self>, right: Option<Self>, ) -> Self
Creates an exclusive range.
Sourcepub fn range_inclusive(loc: Loc, left: Option<Self>, right: Self) -> Self
pub fn range_inclusive(loc: Loc, left: Option<Self>, right: Self) -> Self
Creates an inclusive range.
Trait Implementations§
impl<'input> StructuralPartialEq for Expr<'input>
Auto Trait Implementations§
impl<'input> Freeze for Expr<'input>
impl<'input> RefUnwindSafe for Expr<'input>
impl<'input> Send for Expr<'input>
impl<'input> Sync for Expr<'input>
impl<'input> Unpin for Expr<'input>
impl<'input> UnwindSafe for Expr<'input>
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