pub struct Expr {
pub kind: ExprKind,
pub span: Span,
}Expand description
Expression node in the AST with source location.
Fields§
§kind: ExprKind§span: SpanImplementations§
Source§impl Expr
impl Expr
pub fn literal(value: Decimal, span: Span) -> Self
pub fn ident(name: String, span: Span) -> Self
pub fn unary(op: UnOp, expr: Expr, span: Span) -> Self
pub fn binary(op: BinOp, left: Expr, right: Expr, span: Span) -> Self
pub fn call(name: String, args: Vec<Expr>, span: Span) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin 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