Enhance rhai-repl.

This commit is contained in:
Stephen Chung
2020-12-29 22:04:31 +08:00
parent 049ad3b6fd
commit a45876856d
3 changed files with 89 additions and 10 deletions

View File

@@ -37,6 +37,8 @@ fn eprint_error(input: &str, err: EvalAltResult) {
}
fn main() {
let mut contents = String::new();
for filename in env::args().skip(1) {
let mut engine = Engine::new();
@@ -51,7 +53,7 @@ fn main() {
Ok(f) => f,
};
let mut contents = String::new();
contents.clear();
if let Err(err) = f.read_to_string(&mut contents) {
eprintln!("Error reading script file: {}\n{}", filename, err);