|
SciLex
A header-only C++20 lexer built on REAL
|
A location in the source text. More...
#include <token.hpp>
Public Attributes | |
| std::size_t | offset |
| 0-based byte offset from the start of the source. | |
| std::size_t | line |
| 1-based line number. | |
| std::size_t | column |
| 1-based column within the line, in the lexer's column_unit. | |
A location in the source text.
Columns are counted within the line in the unit the lexer's column_unit names, bytes by default (REAL's byte-level UTF-8 model: a multibyte code point spans several columns), or code points, or UTF-16 code units. Lines and columns are 1-based; a line ends at \n only (a lone \r does not end one). offset is a 0-based byte index from the start of the source, whatever the column unit.
| std::size_t scilex::position::column |
1-based column within the line, in the lexer's column_unit.
| std::size_t scilex::position::line |
1-based line number.
| std::size_t scilex::position::offset |
0-based byte offset from the start of the source.