iffyio commented on code in PR #1497: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1497#discussion_r1833005003
########## src/parser/mod.rs: ########## @@ -5335,7 +5335,7 @@ impl<'a> Parser<'a> { for_query: None, }); - if self.next_token() != Token::Comma { + if self.peek_token().token == Token::SemiColon || self.next_token() != Token::Comma { Review Comment: @wugeer (just double checking since there was a requested review on this MR), did you get a chance to visit this comment yet? just in case, to clarify I was thinking as the fix we could just move the body of the loop (minus line) into a method and call that method via parse_comma_separated. for example ```rust fn parse_mssql_declare_stmt(&mut self) -> Result<Declare, ParserError> { let stmts = self.parse_comma_separated(Parser::parse_mssql_declare_stmt)?; Ok(Statement::Declare { stmts }) } fn parse_mssql_declare_stmt(&mut self) -> Result<Declare, ParserError> { let name = { ...}; // ... remaining body verbatim let assignment = self.parse_mssql_variable_declaration_expression()?; Ok(Declare { names, ... }) } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org