File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,18 +173,14 @@ impl<'input> Lexer<'input> {
173173 // block-comment form (the official compiler rejects `/*` as an
174174 // invalid token). Treating `/*` as a comment would also swallow
175175 // the XML all-children navigation step `x/*`.
176- '/' => {
177- if self . peek_next ( ) == Some ( '/' ) {
178- self . advance ( ) ; // Consume '/'
179- self . advance ( ) ; // Consume second '/'
180- while self . peek ( ) != Some ( & '\n' ) && !self . is_at_end ( ) {
181- self . advance ( ) ;
182- }
183- if self . peek ( ) == Some ( & '\n' ) {
184- self . advance ( ) ;
185- }
186- } else {
187- return Ok ( ( ) ) ;
176+ '/' if self . peek_next ( ) == Some ( '/' ) => {
177+ self . advance ( ) ; // Consume '/'
178+ self . advance ( ) ; // Consume second '/'
179+ while self . peek ( ) != Some ( & '\n' ) && !self . is_at_end ( ) {
180+ self . advance ( ) ;
181+ }
182+ if self . peek ( ) == Some ( & '\n' ) {
183+ self . advance ( ) ;
188184 }
189185 }
190186 _ => return Ok ( ( ) ) ,
You can’t perform that action at this time.
0 commit comments