Skip to content

Commit

Permalink
fix token end calcuation
Browse files Browse the repository at this point in the history
  • Loading branch information
branchseer committed Jan 18, 2025
1 parent 05397cf commit 0024247
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/oxc_parser/src/lexer/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ impl Token {
self.start + u32::from(self.len)
} else {
cold_branch(|| {
long_ends.get(&self.start).copied().unwrap_or(
long_ends.get(&self.start).copied().unwrap_or_else(||
// The token's length happens to be exact `u16::MAX`
u32::from(u16::MAX),
)
self.start + u32::from(u16::MAX))
})
}
}
Expand Down

0 comments on commit 0024247

Please sign in to comment.