MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_source_end_point

Function cbm_source_end_point

internal/cbm/cbm.c:501–512  ·  view source on GitHub ↗

Where the parser stands after reading all `len` real bytes. */

Source from the content-addressed store, hash-verified

499
500/* Where the parser stands after reading all `len` real bytes. */
501static 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 *

Callers 1

cbm_parse_sourceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected