pub enum Expr {
Int(i64, Span),
Float(f64, Span),
Wire(Span),
Cut(Span),
Str(String, Span),
Ref(String, Span),
Apply {
name: String,
args: Vec<Expr>,
span: Span,
},
Neg(Box<Expr>, Span),
Bin {
op: BinOp,
lhs: Box<Expr>,
rhs: Box<Expr>,
span: Span,
},
}Expand description
A rill-lang expression node.
Variants§
Int(i64, Span)
Integer literal.
Float(f64, Span)
Float literal.
Wire(Span)
Identity wire _ (arity 1→1).
Cut(Span)
Cut ! (arity 1→0).
Str(String, Span)
String literal, e.g. "cutoff".
Ref(String, Span)
A reference to a definition or a bound parameter.
Apply
Application name(arg, ...).
Fields
Neg(Box<Expr>, Span)
Unary negation -expr.
Bin
A binary combinator/operator.
Implementations§
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