Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Jan 5, 2023
1 parent 21015c9 commit 78d8c39
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/swc_common/src/syntax_pos/analyze_source_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,15 @@ fn analyze_source_file_generic(
let pos = BytePos::from_usize(i) + output_offset;

match byte {
b'\n' | b'\r' => {
b'\r' => {
lines.push(pos + BytePos(1));
if let Some(b'\n') = src_bytes.get(i as usize + 1) {
i += 2;
continue;
}
}

b'\n' => {
lines.push(pos + BytePos(1));
}
b'\t' => {
Expand Down

0 comments on commit 78d8c39

Please sign in to comment.