| 188 | /* ── Section dispatcher ──────────────────────────────────────── */ |
| 189 | |
| 190 | static 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 | |
| 211 | static int parse_workspace_kv(CBMArena* a, const char* s, int len, int from, |
| 212 | CBMCargoManifest* out) { |
no test coverage detected