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