Break on ctrl-D

This commit is contained in:
greg 2015-07-19 17:11:22 -07:00
parent 4f17d5a0dc
commit 3058af4f05
1 changed files with 3 additions and 0 deletions

View File

@ -38,6 +38,9 @@ fn repl() {
let line = stdin.lock().read_line(&mut buf);
match line {
Ok(_) => {
if buf.is_empty() {
break;
}
let tokens = tokenize(&buf);
buf.clear();
println!("Tokens: {:?}", tokens);