| 1442 | static void gc_eval(const gc_scope_t *sc, const char *s, size_t n, int depth, gc_val_t *out); |
| 1443 | |
| 1444 | static void gc_join(gc_val_t *acc, const gc_val_t *part, bool path) { |
| 1445 | if (!acc->known) { |
| 1446 | return; |
| 1447 | } |
| 1448 | bool empty = !acc->s[0]; |
| 1449 | if (!part->known || part->open_root) { |
| 1450 | if (!path || !empty) { |
| 1451 | acc->known = false; /* an unknown part after a known one */ |
| 1452 | return; |
| 1453 | } |
| 1454 | acc->open_root = true; /* still the leading, unknown root */ |
| 1455 | if (!part->known) { |
| 1456 | return; |
| 1457 | } |
| 1458 | } |
| 1459 | size_t al = strlen(acc->s); |
| 1460 | bool sep = path && al && part->s[0] && acc->s[al - SKIP_ONE] != '/' && part->s[0] != '/'; |
| 1461 | snprintf(acc->s + al, sizeof(acc->s) - al, "%s%s", sep ? "/" : "", part->s); |
| 1462 | } |
| 1463 | |
| 1464 | /* A local assigned exactly once in the enclosing function, before the call. */ |
| 1465 | static bool gc_local(const gc_scope_t *sc, const char *name, size_t nl, const char **vs, |