Break on ctrl-D
This commit is contained in:
parent
4f17d5a0dc
commit
3058af4f05
@ -38,6 +38,9 @@ fn repl() {
|
|||||||
let line = stdin.lock().read_line(&mut buf);
|
let line = stdin.lock().read_line(&mut buf);
|
||||||
match line {
|
match line {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
|
if buf.is_empty() {
|
||||||
|
break;
|
||||||
|
}
|
||||||
let tokens = tokenize(&buf);
|
let tokens = tokenize(&buf);
|
||||||
buf.clear();
|
buf.clear();
|
||||||
println!("Tokens: {:?}", tokens);
|
println!("Tokens: {:?}", tokens);
|
||||||
|
Loading…
Reference in New Issue
Block a user