| 1242 | } |
| 1243 | |
| 1244 | static bool parse_scope(cs_index_t *ix, cs_file_t *f, const char *blob) { |
| 1245 | char *buf = ix_strdup(ix, blob); |
| 1246 | if (!buf) { |
| 1247 | return false; |
| 1248 | } |
| 1249 | cs_counts_t n; |
| 1250 | count_records(buf, &n); |
| 1251 | f->nregions = n.regions; |
| 1252 | f->regions = (cs_region_t *)ix_zalloc(ix, (size_t)n.regions * sizeof(cs_region_t)); |
| 1253 | f->usings = (cs_using_t *)ix_alloc(ix, (size_t)n.usings * sizeof(cs_using_t)); |
| 1254 | f->types = (cs_type_t *)ix_alloc(ix, (size_t)n.types * sizeof(cs_type_t)); |
| 1255 | f->members = (cs_member_t *)ix_alloc(ix, (size_t)n.members * sizeof(cs_member_t)); |
| 1256 | f->unplaced = (cs_span_lines_t *)ix_alloc(ix, (size_t)n.unplaced * sizeof(cs_span_lines_t)); |
| 1257 | f->tparams = (cs_tparam_t *)ix_alloc(ix, (size_t)n.tparams * sizeof(cs_tparam_t)); |
| 1258 | if (ix->oom) { |
| 1259 | return false; |
| 1260 | } |
| 1261 | f->regions[0].parent = CS_NONE; |
| 1262 | if (!parse_records(ix, f, buf)) { |
| 1263 | return false; |
| 1264 | } |
| 1265 | finish_ranges(f); |
| 1266 | return finish_lookups(ix, f); |
| 1267 | } |
| 1268 | |
| 1269 | /* ── Units (C# projects) and their global usings ─────────────────── */ |
| 1270 |
no test coverage detected