Commit bcf7e925 authored by Jeff Smits's avatar Jeff Smits

Forgot to apply overlay of guarded choice

parent 343e70f0
......@@ -135,11 +135,9 @@ impl<'a> Eval<'a> for preprocess::Strategy {
use context;
match *self {
Let(ref defs, ref body) => {
// note the + 1, because lets allow recursive definitions
// note the + 1, because `let`s allow recursive definitions
let no_of_scopes = context.scopes.borrow().len() + 1;
context.push_scope(context::Scope::from_let_defs(no_of_scopes, defs.clone()));
// Don't unwind scopes stack when fatal error occurred? Then again, why make such a
// failure case faster at the cost of many extra branches for the happy path...
let result = body.eval(context, current);
context.pop_scope();
result
......@@ -217,6 +215,7 @@ impl<'a> Eval<'a> for preprocess::Strategy {
context.push_overlay();
match s_if.eval(context, current.clone()) {
Ok(current) => {
context.apply_overlay();
s_then.eval(context, current)
}
Err(Error::StrategyFailed) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment