Skip to content

Commit 612dc40

Browse files
committed
Make the logic for exiting the parse_mssql_declare loop more precise
1 parent a72ea54 commit 612dc40

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/parser/mod.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -434,16 +434,6 @@ impl<'a> Parser<'a> {
434434
let statement = self.parse_statement()?;
435435
stmts.push(statement);
436436
expecting_statement_delimiter = true;
437-
if self.peek_token().token != Token::SemiColon {
438-
// If the next valid character is not a semicolon,
439-
// check whether the previous valid character is a semicolon.
440-
// If it is, revert to the previous valid character (i.e., the semicolon);
441-
// otherwise, do nothing.
442-
self.prev_token();
443-
if self.peek_token().token != Token::SemiColon {
444-
self.next_token();
445-
}
446-
};
447437
}
448438
Ok(stmts)
449439
}
@@ -5364,7 +5354,7 @@ impl<'a> Parser<'a> {
53645354
for_query: None,
53655355
});
53665356

5367-
if self.next_token() != Token::Comma {
5357+
if self.peek_token().token == Token::SemiColon || self.next_token() != Token::Comma {
53685358
break;
53695359
}
53705360
}

0 commit comments

Comments
 (0)