Allow chained assignments.

This commit is contained in:
Stephen Chung
2020-03-14 11:51:45 +08:00
parent 9844ae8665
commit d5adee2209
4 changed files with 100 additions and 40 deletions

View File

@@ -171,13 +171,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) {