aboutsummaryrefslogtreecommitdiffstats
path: root/src/parse
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/mod.rs8
1 files changed, 1 insertions, 7 deletions
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 })
}
}