Commit 804f2aba by Jeff Smits

Found problem with interaction overlays and closures, not sure how to solve yet.

parent 39ef659f
......@@ -158,7 +158,12 @@ impl<'a> Eval<'a> for preprocess::Strategy {
.into_iter()
.map(|build_term| build_term.build(context))
.collect::<Result<_>>()?;
sdeft.eval(context, sargs, targs, current)
let result = sdeft.eval(context, sargs, targs, current);
if name == "__fetch_1_0" {
println!("Debug. {:?}", &context.scopes.borrow()[1..]);
println!("Debug. {:?}", &result);
}
result
}
CallDynamic(ref term_name, ref sargs, ref targs) => {
let strategy_name = context.get_term(term_name)?;
......@@ -202,8 +207,9 @@ impl<'a> Eval<'a> for preprocess::Strategy {
strat2.eval(context, current)
}
GuardedLChoice(ref s_if, ref s_then, ref s_else) => {
// TODO: Doesn't work! overlay gets popped off temporarily when calling "closure"
context.push_scope(context::Scope::overlay());
match s_if.eval(context, current.clone()) {
let result = match s_if.eval(context, current.clone()) {
Ok(current) => {
context.apply_overlay()?;
s_then.eval(context, current)
......@@ -216,7 +222,8 @@ impl<'a> Eval<'a> for preprocess::Strategy {
context.pop_scope();
Err(e)
}
}
};
result
}
PrimT(ref name, ref sargs, ref targs) => {
let sargs = sargs
......
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