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

Function cx_lex_read

tests/test_complexity.c:1274–1289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1272} CxLexInput;
1273
1274static const char *cx_lex_read(void *payload, uint32_t byte_index, TSPoint position,
1275 uint32_t *bytes_read) {
1276 (void)position;
1277 CxLexInput *in = (CxLexInput *)payload;
1278 if (byte_index >= in->len) {
1279 *bytes_read = 0;
1280 return "";
1281 }
1282 uint32_t n = in->len - byte_index;
1283 if (n > CX_LEX_CHUNK) {
1284 n = CX_LEX_CHUNK;
1285 }
1286 in->bytes_pulled += n;
1287 *bytes_read = n;
1288 return in->src + byte_index;
1289}
1290
1291/* Bytes pulled while parsing `len` copies of `fill` as ReScript; 0 on failure. */
1292static uint64_t cx_rescript_lex_work(unsigned char fill, uint32_t len) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected