|
SciLex
A header-only C++20 lexer built on REAL
|
Measures the bytes of a source between the start of the line holding an offset and it, over offsets that mostly increase: each byte is read once from the last offset measured, so a pass over a long line stays linear (measured from its line's start at every token, 40 000 entries on one line took 2.5 s). More...
#include <layout.hpp>
Public Member Functions | |
| indent_meter (std::string_view source) noexcept | |
A meter over source, at its start. | |
| indent_measure | operator() (std::size_t offset) |
The indentation of the bytes before offset on its line. | |
Measures the bytes of a source between the start of the line holding an offset and it, over offsets that mostly increase: each byte is read once from the last offset measured, so a pass over a long line stays linear (measured from its line's start at every token, 40 000 entries on one line took 2.5 s).
|
inlineexplicitnoexcept |
A meter over source, at its start.
|
inline |
The indentation of the bytes before offset on its line.
| std::invalid_argument | When offset lies beyond the source. |