part revert clippy, fix parser

This commit is contained in:
damirka 2021-05-06 14:48:41 +03:00
parent ac57fe6410
commit acf5e1dc08

View File

@ -314,9 +314,9 @@ impl ParserContext {
pub fn parse_definition_statement(&mut self) -> SyntaxResult<DefinitionStatement> {
let declare = self.expect_oneof(&[Token::Let, Token::Const])?;
let mut variable_names = Vec::new();
variable_names.push(self.parse_variable_name(&declare)?);
if self.eat(Token::LeftParen).is_some() {
variable_names.push(self.parse_variable_name(&declare)?);
let mut eaten_ending = false;
while self.eat(Token::Comma).is_some() {
if self.eat(Token::RightParen).is_some() {
@ -328,6 +328,8 @@ impl ParserContext {
if !eaten_ending {
self.expect(Token::RightParen)?;
}
} else {
variable_names.push(self.parse_variable_name(&declare)?);
}
let type_ = if self.eat(Token::Colon).is_some() {