Run eval with new State.

This commit is contained in:
Stephen Chung 2020-12-20 23:46:46 +08:00
parent cec27846ea
commit 730a7320d6

View File

@ -678,8 +678,13 @@ impl Engine {
}
// Evaluate the AST
let result = self.eval_statements_raw(scope, mods, state, ast.statements(), lib)?;
let mut new_state: State = Default::default();
new_state.operations = state.operations;
let result =
self.eval_statements_raw(scope, mods, &mut new_state, ast.statements(), lib)?;
state.operations = new_state.operations;
return Ok(result);
}