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

Function jv_lex_java_string

internal/cbm/doclink_jvm.c:1438–1459  ·  view source on GitHub ↗

A Java string or text block at the quote src[i]: past it. An unterminated * string ends with its line. */

Source from the content-addressed store, hash-verified

1436/* A Java string or text block at the quote src[i]: past it. An unterminated
1437 * string ends with its line. */
1438static uint32_t jv_lex_java_string(const jv_scan_t *s, uint32_t i) {
1439 const char *src = s->src;
1440 uint32_t n = s->src_len;
1441 bool block = i + PAIR_LEN < n && src[i + SKIP_ONE] == '"' && src[i + PAIR_LEN] == '"';
1442 uint32_t j = i + (block ? JV_QUOTES : SKIP_ONE);
1443 while (j < n) {
1444 char c = src[j];
1445 if (c == '\\') {
1446 j += PAIR_LEN;
1447 } else if (block && c == '"' && j + PAIR_LEN < n && src[j + SKIP_ONE] == '"' &&
1448 src[j + PAIR_LEN] == '"') {
1449 return j + JV_QUOTES;
1450 } else if (!block && c == '"') {
1451 return j + SKIP_ONE;
1452 } else if (!block && c == '\n') {
1453 return j;
1454 } else {
1455 j++;
1456 }
1457 }
1458 return n;
1459}
1460
1461/* The declaration keywords a type starts with. */
1462static bool jv_type_keyword(const jv_scan_t *s, const char *w, uint32_t len) {

Callers 1

jv_scan_textFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected