Skip to content

Commit 55974f5

Browse files
Update main.rs
Support multi line code input
1 parent 69457a0 commit 55974f5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,16 @@ fn main() {
3939
let mut executor = Executor::new(Mode::Debug);
4040
// REPL実行
4141
loop {
42-
executor.evaluate_program(input("> "))
42+
let mut code = String::new();
43+
loop {
44+
let inputed = input("> ");
45+
code += &format!("{inputed}\n");
46+
if inputed.is_empty() {
47+
break;
48+
}
49+
}
50+
51+
executor.evaluate_program(code)
4352
}
4453
}
4554
}

0 commit comments

Comments
 (0)