Commit 84e98ec1 authored by Jeff Smits's avatar Jeff Smits

Further fixed the move of the stack_tracer code, it was still broken >:(

parent c5b7680b
......@@ -41,13 +41,13 @@ impl<'a> MutContext<'a> {
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
self.stack_tracer.borrow_mut().push(prim_name.to_owned());
let prim_ref = self.primitives
.iter()
.flat_map(|prims| prims.get(prim_name))
.cloned() // very cheap, so whatever
.next()
.ok_or_else(|| Error::UndefinedPrimitive(prim_name.to_owned()))?;
self.stack_tracer.borrow_mut().push(prim_name.to_owned());
let result = eval_prim_ref(prim_ref, self, sargs, targs, current);
if result.is_ok() {
self.stack_tracer.borrow_mut().pop_on_success();
......
......@@ -116,11 +116,7 @@ impl<'a> Eval<'a> for preprocess::Strategy {
}
CallT(ref name, ref sargs, ref targs) => {
let sdeft = context
.get_strategy(name)
.map_err(|e| {
context.stack_tracer.borrow_mut().pop_on_failure();
e
})?;
.get_strategy(name)?;
let sargs = sargs
.into_iter()
.cloned()
......@@ -129,11 +125,7 @@ impl<'a> Eval<'a> for preprocess::Strategy {
let targs = targs
.into_iter()
.map(|build_term| eval_build(context, build_term))
.collect::<Result<_>>()
.map_err(|e| {
context.stack_tracer.borrow_mut().pop_on_failure();
e
})?;
.collect::<Result<_>>()?;
sdeft.eval(context, sargs, targs, current)
}
// TODO
......@@ -171,11 +163,7 @@ impl<'a> Eval<'a> for preprocess::Strategy {
let targs = targs
.into_iter()
.map(|build_term| eval_build(context, build_term))
.collect::<Result<_>>()
.map_err(|e| {
context.stack_tracer.borrow_mut().pop_on_failure();
e
})?;
.collect::<Result<_>>()?;
context.call_primitive(name, sargs, targs, current)
}
Some(ref strat) => eval_some(strat, context, current),
......
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