diff --git a/src/parser.rs b/src/parser.rs index 57aa097..fb6de0c 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -119,7 +119,6 @@ macro_rules! expect_identifier { } } - fn is_delimiter(token: &Token) -> bool { use tokenizer::Token::*; match *token { @@ -179,22 +178,15 @@ impl Parser { fn identlist(&mut self) -> ParseResult> { use tokenizer::Token::*; let mut args: Vec = Vec::new(); - loop { - match self.peek() { - Some(Identifier(name)) => { - args.push(name); - self.next(); - if let Some(Comma) = self.peek() { - self.next(); - } else { - break; - } - }, - - _ => break + while let Some(Identifier(name)) = self.peek() { + args.push(name); + self.next(); + if let Some(Comma) = self.peek() { + self.next(); + } else { + break; } } - Ok(args) }