Skip to content

Commit 159a524

Browse files
committed
Don't double-count newlines in comments
lex_comment doesn't consume the newlines, (correctly) leaving them to the regular newline parsing. As such, it shouldn't call self.new_line, or we end up double-counting lines.
1 parent 6aff83e commit 159a524

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

parser/src/lexer.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,9 @@ impl<'input> Lexer<'input> {
140140
self.next_char();
141141
match self.chr0 {
142142
Some('\n') => {
143-
self.new_line();
144143
return;
145144
}
146145
Some('\r') => {
147-
self.new_line();
148146
return;
149147
}
150148
Some(_) => {}

0 commit comments

Comments
 (0)