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

Function parse_string

internal/cbm/lsp/rust_cargo.c:61–75  ·  view source on GitHub ↗

Parse a string literal (single or double quoted). */

Source from the content-addressed store, hash-verified

59
60/* Parse a string literal (single or double quoted). */
61static int parse_string(CBMArena* a, const char* s, int len, int from,
62 const char** out) {
63 if (from >= len) return from;
64 char q = s[from];
65 if (q != '"' && q != '\'') return from;
66 from++;
67 int start = from;
68 while (from < len && s[from] != q) {
69 if (s[from] == '\\' && from + 1 < len) from += 2;
70 else from++;
71 }
72 *out = cbm_arena_strndup(a, s + start, (size_t)(from - start));
73 if (from < len) from++;
74 return from;
75}
76
77/* Skip a value (used for keys we don't care about). Handles strings,
78 * arrays, inline tables, bare values. */

Callers 3

parse_dep_entryFunction · 0.85
parse_package_kvFunction · 0.85
parse_workspace_kvFunction · 0.85

Calls 1

cbm_arena_strndupFunction · 0.50

Tested by

no test coverage detected