| 482 | } CBMStringInput; |
| 483 | |
| 484 | static const char *cbm_string_read(void *payload, uint32_t byte, TSPoint point, |
| 485 | uint32_t *bytes_read) { |
| 486 | (void)point; |
| 487 | CBMStringInput *self = (CBMStringInput *)payload; |
| 488 | if (byte >= self->length) { |
| 489 | if (self->virtual_newline && byte == self->length) { |
| 490 | *bytes_read = 1; |
| 491 | return "\n"; |
| 492 | } |
| 493 | *bytes_read = 0; |
| 494 | return ""; |
| 495 | } |
| 496 | *bytes_read = self->length - byte; |
| 497 | return self->string + byte; |
| 498 | } |
| 499 | |
| 500 | /* Where the parser stands after reading all `len` real bytes. */ |
| 501 | static TSPoint cbm_source_end_point(const char *source, uint32_t len) { |
nothing calls this directly
no outgoing calls
no test coverage detected