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

Function parse_key

internal/cbm/lsp/rust_cargo.c:39–58  ·  view source on GitHub ↗

Parse a bare key (ident-like). Stores arena-allocated copy in *out. */

Source from the content-addressed store, hash-verified

37
38/* Parse a bare key (ident-like). Stores arena-allocated copy in *out. */
39static int parse_key(CBMArena* a, const char* s, int len, int from,
40 const char** out) {
41 int start = from;
42 if (from < len && s[from] == '"') {
43 from++;
44 start = from;
45 while (from < len && s[from] != '"') {
46 if (s[from] == '\\' && from + 1 < len) from += 2;
47 else from++;
48 }
49 *out = cbm_arena_strndup(a, s + start, (size_t)(from - start));
50 if (from < len && s[from] == '"') from++;
51 return from;
52 }
53 while (from < len && is_ident_char(s[from])) from++;
54 if (from > start) {
55 *out = cbm_arena_strndup(a, s + start, (size_t)(from - start));
56 }
57 return from;
58}
59
60/* Parse a string literal (single or double quoted). */
61static int parse_string(CBMArena* a, const char* s, int len, int from,

Callers 3

parse_dep_entryFunction · 0.85
parse_package_kvFunction · 0.85
parse_workspace_kvFunction · 0.85

Calls 2

is_ident_charFunction · 0.85
cbm_arena_strndupFunction · 0.50

Tested by

no test coverage detected