diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-09-21 15:43:59 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-09-21 15:43:59 -0400 |
| commit | 71f73d8b3ce63f9a3685bc1a1686ef4fab3294a6 (patch) | |
| tree | 99fe1309fa4d24609867dcc62859caed909a76d9 /src/parse/containers.c | |
| parent | f5612e38183dc20d18f207f8ab055574a4d93ad0 (diff) | |
Deprecate sets
Diffstat (limited to 'src/parse/containers.c')
| -rw-r--r-- | src/parse/containers.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/parse/containers.c b/src/parse/containers.c index 73d30ecd..b7378b18 100644 --- a/src/parse/containers.c +++ b/src/parse/containers.c @@ -96,33 +96,3 @@ ast_t *parse_table(parse_ctx_t *ctx, const char *pos) { return NewAST(ctx->file, start, pos, Table, .default_value = default_value, .entries = entries, .fallback = fallback); } - -ast_t *parse_set(parse_ctx_t *ctx, const char *pos) { - const char *start = pos; - if (match(&pos, "||")) return NewAST(ctx->file, start, pos, Set); - - if (!match(&pos, "|")) return NULL; - whitespace(ctx, &pos); - - ast_list_t *items = NULL; - for (;;) { - ast_t *item = optional(ctx, &pos, parse_extended_expr); - if (!item) break; - whitespace(ctx, &pos); - ast_t *suffixed = parse_comprehension_suffix(ctx, item); - while (suffixed) { - item = suffixed; - pos = suffixed->end; - suffixed = parse_comprehension_suffix(ctx, item); - } - items = new (ast_list_t, .ast = item, .next = items); - if (!match_separator(ctx, &pos)) break; - } - - REVERSE_LIST(items); - - whitespace(ctx, &pos); - expect_closing(ctx, &pos, "|", "I wasn't able to parse the rest of this set"); - - return NewAST(ctx->file, start, pos, Set, .items = items); -} |
