This commit is contained in:
nlohmann
2026-10-13 15:18:42 +00:00
parent 22fba27145
commit e12071023d
6 changed files with 287 additions and 285 deletions
+4 -2
View File
@@ -185,9 +185,11 @@ The lexer detects two optional extensions at compile time. Only `iterator_input_
random-access input of single-byte characters:
- `supports_seek`, `get_consumed_count()`, and `copy_consumed_range()` let the lexer reconstruct already consumed input
for error messages instead of copying every character it reads.
for error messages instead of copying every character it reads. With `get_read_count()` and
`count_consumed_lines()`, the lexer also derives the read position from the adapter and counts lines only when an
error needs them, instead of counting characters and lines on every read.
- `supports_bulk_scan`, `bulk_data()`, `bulk_remaining()`, and `bulk_skip()` let the lexer scan strings directly in
contiguous memory, several bytes at a time.
contiguous memory, several bytes at a time, and skip the spaces that indent a line in 8-byte steps.
The function `input_adapter` picks the right adapter for the argument passed to `parse`, `accept`, `sax_parse`, or the
`from_*` functions:
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -164,8 +164,8 @@ std::size_t get_elements(T* dest, std::size_t count = 1);
The lexer detects two optional extensions at compile time. Only `iterator_input_adapter` provides them, and only for random-access input of single-byte characters:
- `supports_seek`, `get_consumed_count()`, and `copy_consumed_range()` let the lexer reconstruct already consumed input for error messages instead of copying every character it reads.
- `supports_bulk_scan`, `bulk_data()`, `bulk_remaining()`, and `bulk_skip()` let the lexer scan strings directly in contiguous memory, several bytes at a time.
- `supports_seek`, `get_consumed_count()`, and `copy_consumed_range()` let the lexer reconstruct already consumed input for error messages instead of copying every character it reads. With `get_read_count()` and `count_consumed_lines()`, the lexer also derives the read position from the adapter and counts lines only when an error needs them, instead of counting characters and lines on every read.
- `supports_bulk_scan`, `bulk_data()`, `bulk_remaining()`, and `bulk_skip()` let the lexer scan strings directly in contiguous memory, several bytes at a time, and skip the spaces that indent a line in 8-byte steps.
The function `input_adapter` picks the right adapter for the argument passed to `parse`, `accept`, `sax_parse`, or the `from_*` functions:
File diff suppressed because one or more lines are too long
+278 -278
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.