Don't allow nested line comment inside block comment (#3048)

This commit is contained in:
Heinenen 2023-12-30 14:01:05 +01:00 committed by GitHub
parent c4d9b0c3d8
commit c27b9e2b0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 9 deletions

View File

@ -145,10 +145,6 @@ impl Lexer<'_> {
depth += 1; depth += 1;
'_' '_'
} }
('/', '/') => {
self.line_comment();
'_'
}
_ => c, _ => c,
} }
} }

View File

@ -17,13 +17,14 @@ C/*
// End of block comment in line comment. // End of block comment in line comment.
// Hello */ // Hello */
// Nested line comment. // Nested "//" doesn't count as line comment.
/* // */ /* // */
Still comment.
*/
E E
/*//*/
This is a comment.
*/*/
--- ---
// End should not appear without start. // End should not appear without start.
// Error: 7-9 unexpected end of block comment // Error: 7-9 unexpected end of block comment