diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 1 | ||||
| -rw-r--r-- | src/parse/mod.rs | 8 |
2 files changed, 2 insertions, 7 deletions
@@ -353,6 +353,7 @@ impl Session { self.highlighter .pretty_print(&buf, parser.highlights, &mut stdout)?; cursor::fmove_cursor(cursor::Direction::Left, self.line.right_len(), &mut stdout)?; + stdout.flush()?; } } diff --git a/src/parse/mod.rs b/src/parse/mod.rs index 97a6e4a..1c1b184 100644 --- a/src/parse/mod.rs +++ b/src/parse/mod.rs @@ -1594,15 +1594,9 @@ impl Parse for If<PreExpansion> { impl Parse for While { fn parse(b: &mut Cursor<'_>) -> Result<Self> { - b.spaces(); - if !b.buf.starts_with(b"while ") || b.buf.starts_with(b"while\t") { - return Err(ParseError::NotAWhile); - } - b.advance(6); - b.spaces(); + b.consume_keyword(Keyword::While)?; let condition = Pipes::parse(b)?; let block = Block::parse(b)?; - Ok(Self { condition, block }) } } |
