NewPosition creates a new Position with the specified line and byte index. The column is initialized to 1 (first column). Parameters: - line: Line number (1-based, typically starts at 1) - index: Byte offset into input (0-based, typically starts at 0) Returns a Position ready for use in tokenizati
(line, index int)
| 51 | // |
| 52 | // Returns a Position ready for use in tokenization. |
| 53 | func NewPosition(line, index int) Position { |
| 54 | return Position{ |
| 55 | Line: line, |
| 56 | Index: index, |
| 57 | Column: 1, |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | // Location converts this Position to a models.Location using the tokenizer's |
| 62 | // line tracking information for accurate column calculation. |
no outgoing calls