SciLex
A header-only C++20 lexer built on REAL
Loading...
Searching...
No Matches
Public Attributes | List of all members
scilex::position Struct Reference

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 byte column within the line.
 

Detailed Description

A location in the source text.

Columns are counted in bytes within the line, consistent with REAL's byte-level UTF-8 model (an ASCII column equals a character column; a multibyte codepoint spans several byte columns). Lines and columns are 1-based; offset is a 0-based byte index from the start of the source.

Definition at line 47 of file token.hpp.

Member Data Documentation

◆ column

std::size_t scilex::position::column

1-based byte column within the line.

Definition at line 51 of file token.hpp.

◆ line

std::size_t scilex::position::line

1-based line number.

Definition at line 50 of file token.hpp.

◆ offset

std::size_t scilex::position::offset

0-based byte offset from the start of the source.

Definition at line 49 of file token.hpp.


The documentation for this struct was generated from the following file: