From 00eca98c6a897482c919e5dc1da48c9541bc34fd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 5 Jan 2025 07:49:52 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- crates/djls-template-ast/src/ast.rs | 6 +++--- crates/djls-template-ast/src/lexer.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/djls-template-ast/src/ast.rs b/crates/djls-template-ast/src/ast.rs index 8df4ad0..a191235 100644 --- a/crates/djls-template-ast/src/ast.rs +++ b/crates/djls-template-ast/src/ast.rs @@ -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) diff --git a/crates/djls-template-ast/src/lexer.rs b/crates/djls-template-ast/src/lexer.rs index d1975e8..fa873ae 100644 --- a/crates/djls-template-ast/src/lexer.rs +++ b/crates/djls-template-ast/src/lexer.rs @@ -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