[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2025-01-05 07:49:52 +00:00
parent a75f743ded
commit 00eca98c6a
2 changed files with 4 additions and 4 deletions

View file

@ -56,7 +56,7 @@ impl LineOffsets {
pub fn position_to_line_col(&self, offset: u32) -> (u32, u32) {
eprintln!("LineOffsets: Converting position {} to line/col. Offsets: {:?}", offset, self.0);
// Find which line contains this offset by looking for the first line start
// that's greater than our position
let line = match self.0.binary_search(&offset) {
@ -76,10 +76,10 @@ impl LineOffsets {
}
}
};
// Calculate column as offset from line start
let col = offset - self.0[line];
eprintln!("LineOffsets: Found line {} starting at offset {}", line, self.0[line]);
eprintln!("LineOffsets: Calculated col {} as {} - {}", col, offset, self.0[line]);
(line as u32, col)

View file

@ -61,7 +61,7 @@ impl Lexer {
'\n' => {
self.consume()?;
let token = TokenType::Newline;
eprintln!("Lexer: Found newline at position {}, incrementing line from {} to {}",
eprintln!("Lexer: Found newline at position {}, incrementing line from {} to {}",
self.start, self.line, self.line + 1);
self.line += 1;
token