diff --git a/frustration.rs b/frustration.rs index e7aafc2..3346f20 100644 --- a/frustration.rs +++ b/frustration.rs @@ -144,7 +144,10 @@ fn create_d(c: &mut Core) { create(c, short_name); c.post = Post::EatWord; } - _ => {} + _ => { + println!(" create needs an argument"); + c.post = Post::WarmReset; + } } } @@ -456,6 +459,7 @@ fn outer(c: &mut Core, s: &str) { Post::WarmReset => { c.tds = 0; c.trs = 0; + c.state = State::Interpreting; break; // discard rest of input line } Post::Nothing => { } @@ -468,7 +472,13 @@ fn main() { loop { let mut buf = String::new(); match io::stdin().read_line(&mut buf) { - Ok(_) => { outer(&mut c, &buf); println!(" ok");} + Ok(_) => { + outer(&mut c, &buf); + match c.state { + State::Interpreting => {println!(" ok")} + State::Compiling => {} + }; + } Err(_) => { break; } } }