Enum evaltrees::ast::Expr [−][src]
pub enum Expr<Aux> { If(Box<Expr<Aux>>, Box<Expr<Aux>>, Box<Expr<Aux>>, Aux), Literal(Literal, Aux), Op(Op, Box<Expr<Aux>>, Box<Expr<Aux>>, Aux), Variable(Symbol, Aux), }
An expression.
Variants
If(Box<Expr<Aux>>, Box<Expr<Aux>>, Box<Expr<Aux>>, Aux)
A conditional expression.
Literal(Literal, Aux)
A literal value.
Op(Op, Box<Expr<Aux>>, Box<Expr<Aux>>, Aux)
A binary operator.
Variable(Symbol, Aux)
A variable.
Methods
impl<Aux> Expr<Aux>
[src]
impl<Aux> Expr<Aux>
impl<Aux> Expr<Aux>
[src]
impl<Aux> Expr<Aux>
pub fn display_as<'a>(
&'a self,
style: PrintStyle
) -> impl 'a + Display
[src]
pub fn display_as<'a>(
&'a self,
style: PrintStyle
) -> impl 'a + Display
Returns a Display that follows the given print style.
impl<Aux> Expr<Aux>
[src]
impl<Aux> Expr<Aux>
pub fn aux_ref(&self) -> &Aux
[src]
pub fn aux_ref(&self) -> &Aux
Gets the auxiliary data as a reference.
pub fn free_count(&self) -> BTreeMap<Symbol, usize>
[src]
pub fn free_count(&self) -> BTreeMap<Symbol, usize>
Returns the number of occurrences of variables.
pub fn freevars(&self) -> BTreeSet<Symbol>
[src]
pub fn freevars(&self) -> BTreeSet<Symbol>
Returns the free variables of an expression.
pub fn map_aux<Aux2, F: Copy + Fn(Aux) -> Aux2>(self, f: F) -> Expr<Aux2>
[src]
pub fn map_aux<Aux2, F: Copy + Fn(Aux) -> Aux2>(self, f: F) -> Expr<Aux2>
Modifies the aux value, recursively.
impl<Aux: Clone> Expr<Aux>
[src]
impl<Aux: Clone> Expr<Aux>
Trait Implementations
impl<Aux: Clone> Clone for Expr<Aux>
[src]
impl<Aux: Clone> Clone for Expr<Aux>
fn clone(&self) -> Expr<Aux>
[src]
fn clone(&self) -> Expr<Aux>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<Aux: Debug> Debug for Expr<Aux>
[src]
impl<Aux: Debug> Debug for Expr<Aux>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<Aux> Display for Expr<Aux>
[src]
impl<Aux> Display for Expr<Aux>
fn fmt(&self, fmt: &mut Formatter) -> Result
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<Aux: PartialEq> PartialEq for Expr<Aux>
[src]
impl<Aux: PartialEq> PartialEq for Expr<Aux>