File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -1387,7 +1387,11 @@ impl<'a> Tokenizer<'a> {
13871387 Some ( '-' ) => {
13881388 let mut is_comment = true ;
13891389 if self . dialect . requires_single_line_comment_whitespace ( ) {
1390- is_comment = Some ( ' ' ) == chars. peekable . clone ( ) . nth ( 1 ) ;
1390+ is_comment = chars
1391+ . peekable
1392+ . clone ( )
1393+ . nth ( 1 )
1394+ . is_some_and ( char:: is_whitespace) ;
13911395 }
13921396
13931397 if is_comment {
@@ -4069,6 +4073,24 @@ mod tests {
40694073 Token :: Minus ,
40704074 ] ,
40714075 ) ;
4076+
4077+ all_dialects_where ( |d| d. requires_single_line_comment_whitespace ( ) ) . tokenizes_to (
4078+ "--\n -- Table structure for table...\n --\n " ,
4079+ vec ! [
4080+ Token :: Whitespace ( Whitespace :: SingleLineComment {
4081+ prefix: "--" . to_string( ) ,
4082+ comment: "\n " . to_string( ) ,
4083+ } ) ,
4084+ Token :: Whitespace ( Whitespace :: SingleLineComment {
4085+ prefix: "--" . to_string( ) ,
4086+ comment: " Table structure for table...\n " . to_string( ) ,
4087+ } ) ,
4088+ Token :: Whitespace ( Whitespace :: SingleLineComment {
4089+ prefix: "--" . to_string( ) ,
4090+ comment: "\n " . to_string( ) ,
4091+ } ) ,
4092+ ] ,
4093+ ) ;
40724094 }
40734095
40744096 #[ test]
You can’t perform that action at this time.
0 commit comments