Expand description
Source location tracking for error reporting.
Provides types for tracking positions within source code:
BytePos: A byte offset into source textSpan: A range of bytes representing a source regionSpanned<T>: A value paired with its source location
Structs§
- BytePos
- A byte position in source code.
- Span
- A span representing a range of source code.
- Spanned
- A value with an associated source span.
Functions§
- get_
line - Returns the line containing a position.
- line_
col - Computes line and column from a byte position.
- line_
number - Returns the line number (1-indexed) for a position.