Fix tests.

This commit is contained in:
Stephen Chung 2021-05-22 19:34:10 +08:00
parent cc3e2d79a5
commit d07d4d295d
3 changed files with 20 additions and 20 deletions

View File

@ -2509,7 +2509,7 @@ fn parse_stmt(
let mut comments_pos = Position::NONE; let mut comments_pos = Position::NONE;
// Handle doc-comments. // Handle doc-comments.
while let (Token::Comment(ref comment), pos) = input.peek().expect(INPUT_NEVER_ENDS) { while let (Token::Comment(ref comment), pos) = input.peek().expect(NEVER_ENDS) {
if comments_pos.is_none() { if comments_pos.is_none() {
comments_pos = *pos; comments_pos = *pos;
} }
@ -2526,7 +2526,7 @@ fn parse_stmt(
Token::Comment(comment) => { Token::Comment(comment) => {
comments.push(comment); comments.push(comment);
match input.peek().expect(INPUT_NEVER_ENDS) { match input.peek().expect(NEVER_ENDS) {
(Token::Fn, _) | (Token::Private, _) => break, (Token::Fn, _) | (Token::Private, _) => break,
(Token::Comment(_), _) => (), (Token::Comment(_), _) => (),
_ => return Err(PERR::WrongDocComment.into_err(comments_pos)), _ => return Err(PERR::WrongDocComment.into_err(comments_pos)),