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

Function parse_package_kv

internal/cbm/lsp/rust_cargo.c:190–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188/* ── Section dispatcher ──────────────────────────────────────── */
189
190static int parse_package_kv(CBMArena* a, const char* s, int len, int from,
191 CBMCargoManifest* out) {
192 from = skip_ws_and_comment(s, len, from);
193 if (from >= len || s[from] == '[') return from;
194 const char* key = NULL;
195 from = parse_key(a, s, len, from, &key);
196 from = skip_ws_and_comment(s, len, from);
197 if (from < len && s[from] == '=') {
198 from++;
199 from = skip_ws_and_comment(s, len, from);
200 }
201 if (key && strcmp(key, "name") == 0) {
202 from = parse_string(a, s, len, from, &out->package_name);
203 } else if (key && strcmp(key, "version") == 0) {
204 from = parse_string(a, s, len, from, &out->package_version);
205 } else {
206 from = skip_value(s, len, from);
207 }
208 return from;
209}
210
211static int parse_workspace_kv(CBMArena* a, const char* s, int len, int from,
212 CBMCargoManifest* out) {

Callers 1

cbm_cargo_parseFunction · 0.85

Calls 4

skip_ws_and_commentFunction · 0.85
parse_keyFunction · 0.85
parse_stringFunction · 0.85
skip_valueFunction · 0.85

Tested by

no test coverage detected