more efficient tracebacks
Signed-off-by: Ava Affine <ava@sunnypup.io>
This commit is contained in:
parent
8f0e2512cc
commit
9796c20c5d
2 changed files with 6 additions and 7 deletions
|
|
@ -330,7 +330,7 @@ example: (circuit (eq? (do-operation) myresult)
|
|||
in this example, do-another-operation will not be called";
|
||||
fn circuit_callback(ast: &Seg, syms: &mut SymTable) -> Result<Ctr, Traceback> {
|
||||
let mut cursor = 0;
|
||||
let mut err_trace = Traceback::new();
|
||||
let mut err_trace: Traceback = Traceback::new();
|
||||
let result = ast.circuit(&mut |form: &Ctr| -> bool {
|
||||
cursor += 1;
|
||||
let operand: &Seg;
|
||||
|
|
@ -358,7 +358,7 @@ fn circuit_callback(ast: &Seg, syms: &mut SymTable) -> Result<Ctr, Traceback> {
|
|||
} else if let Ctr::Integer(i) = *s.car {
|
||||
return i==0;
|
||||
} else {
|
||||
err_trace = err_trace.with_trace(
|
||||
err_trace = err_trace.clone().with_trace(
|
||||
("circuit", "impossible condition")
|
||||
.into());
|
||||
}
|
||||
|
|
@ -366,7 +366,7 @@ fn circuit_callback(ast: &Seg, syms: &mut SymTable) -> Result<Ctr, Traceback> {
|
|||
|
||||
Ctr::Integer(i) => return i == 0,
|
||||
|
||||
_ => err_trace = err_trace.with_trace(
|
||||
_ => err_trace = err_trace.clone().with_trace(
|
||||
("circuit", format!("form {cursor} did not evaluate to a boolean"))
|
||||
.into()),
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue