[−][src]Struct libslide::partial_evaluator::variable_expand::EagerVariableExpander
Eagerly expands variables in an expression.
An EagerVariableExpander
expands all matching variables on every call to
expand
.
For example, "a + b".expand("a = b + 1").expand("b = c")
would expand to "c + 1 + c"
.
Compare this to a LazyVariableExpander
.
Note, however, that an EagerVariableExpander
will not try to expand variables within an
expanded variable definition on the same call to expand
.
For example, "a".expand("a = a + a")
would expand to "a + a"
rather than
"a + a + a + a + ..."
.
Fields
expr: RcExpr
expand_def: Option<&'a Assignment>
Trait Implementations
impl<'a> ExpressionTransformer<'a> for EagerVariableExpander<'a>
[src]
fn transform_var(&self, var: &'a InternedStr, span: Span) -> RcExpr
[src]
fn transform(&self, expr: &'a RcExpr) -> RcExpr
[src]
fn transform_const(&self, konst: &f64, span: Span) -> RcExpr
[src]
fn transform_binary_op(&self, op: BinaryOperator) -> BinaryOperator
[src]
fn transform_binary(&self, expr: &'a BinaryExpr<RcExpr>, span: Span) -> RcExpr
[src]
fn transform_unary_op(&self, op: UnaryOperator) -> UnaryOperator
[src]
fn transform_unary(&self, expr: &'a UnaryExpr<RcExpr>, span: Span) -> RcExpr
[src]
fn transform_parend(&self, expr: &'a RcExpr, span: Span) -> RcExpr
[src]
fn transform_bracketed(&self, expr: &'a RcExpr, span: Span) -> RcExpr
[src]
impl<'a> VariableExpander<'a> for EagerVariableExpander<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for EagerVariableExpander<'a>
impl<'a> Send for EagerVariableExpander<'a>
impl<'a> Sync for EagerVariableExpander<'a>
impl<'a> Unpin for EagerVariableExpander<'a>
impl<'a> UnwindSafe for EagerVariableExpander<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,