| 1272 | } CxLexInput; |
| 1273 | |
| 1274 | static 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. */ |
| 1292 | static uint64_t cx_rescript_lex_work(unsigned char fill, uint32_t len) { |
nothing calls this directly
no outgoing calls
no test coverage detected