Where the parser stands after reading all `len` real bytes. */
| 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) { |
| 502 | TSPoint end = {0, 0}; |
| 503 | const char *p = source; |
| 504 | const char *stop = source + len; |
| 505 | const char *nl; |
| 506 | while (p < stop && (nl = memchr(p, '\n', (size_t)(stop - p))) != NULL) { |
| 507 | end.row++; |
| 508 | p = nl + 1; |
| 509 | } |
| 510 | end.column = (uint32_t)(stop - p); |
| 511 | return end; |
| 512 | } |
| 513 | |
| 514 | /* #2078: parse every file as if its last line were terminated. |
| 515 | * |