diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-02-24 12:52:56 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-02-24 12:52:56 -0500 |
| commit | e59ad7befb274cff2a58c983bfe25c85c38c612d (patch) | |
| tree | 88838c967632934bc992ded67c223a835fd222ab /parse.c | |
| parent | 8bee541c76ebea46ea1c809805270bb69595a56a (diff) | |
Deprecate arr[.field] for now
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 16 |
1 files changed, 1 insertions, 15 deletions
@@ -764,21 +764,7 @@ ast_t *parse_index_suffix(parse_ctx_t *ctx, ast_t *lhs) { const char *pos = lhs->end; if (!match(&pos, "[")) return NULL; whitespace(&pos); - ast_t *index = NULL; - if (match(&pos, ".")) { - // array[.field] - const char *field_start = pos-1; - const char *field = get_id(&pos); - if (field) - index = NewAST(ctx->file, field_start, pos, FieldAccess, .field=field); - else - --pos; - } - - if (!index) { - // obj[expr] - index = optional(ctx, &pos, parse_extended_expr); - } + ast_t *index = optional(ctx, &pos, parse_extended_expr); whitespace(&pos); bool unchecked = match(&pos, ";") && (spaces(&pos), match_word(&pos, "unchecked") != 0); expect_closing(ctx, &pos, "]", "I wasn't able to parse the rest of this index"); |
