Collect the declarations under `root` in document order. `owner` is the * item of the type whose members a node holds (CS_OWNER_NONE outside a type). * Preprocessor blocks and error nodes are looked into: a declaration that * parsed is a declaration wherever recovery left it, and its placement is * checked against the braces afterwards. What sits in an error node belongs * to whichever block'
| 2364 | * The walk keeps its own stack: how deep declarations nest is the file's |
| 2365 | * choice, and must not be this thread's stack depth. */ |
| 2366 | static void cs_collect(cs_scan_t *s, TSNode root, int owner) { |
| 2367 | cs_walk_stack_t w = {0}; |
| 2368 | bool ok = !s->failed && cs_walk_push(s, &w, root, owner); |
| 2369 | while (w.count > 0) { |
| 2370 | /* a child may push a frame, which moves the array: no pointer into it |
| 2371 | * is kept across cs_collect_child */ |
| 2372 | TSNode c; |
| 2373 | if (!ok || s->failed || !cs_kids_next_named(&w.frames[w.count - SKIP_ONE].kids, &c)) { |
| 2374 | cs_kids_end(&w.frames[w.count - SKIP_ONE].kids); |
| 2375 | w.count--; |
| 2376 | continue; |
| 2377 | } |
| 2378 | ok = cs_collect_child(s, &w, c, w.frames[w.count - SKIP_ONE].owner); |
| 2379 | } |
| 2380 | } |
| 2381 | |
| 2382 | /* ── Declarations the tree has no node for ───────────────────────── */ |
| 2383 |
no test coverage detected