Merge branch 'chained-assignments'

This commit is contained in:
Stephen Chung
2020-03-14 14:41:48 +08:00
4 changed files with 100 additions and 40 deletions

View File

@@ -190,13 +190,15 @@ impl<'e> Engine<'e> {
statements
};
let result = statements
.iter()
.try_fold(().into_dynamic(), |_, stmt| engine.eval_stmt(scope, stmt));
let mut result = ().into_dynamic();
for stmt in statements {
result = engine.eval_stmt(scope, stmt)?;
}
engine.clear_functions();
result
Ok(result)
}
match eval_ast_internal(self, scope, ast) {