aboutsummaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-02-24 12:52:56 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-02-24 12:52:56 -0500
commite59ad7befb274cff2a58c983bfe25c85c38c612d (patch)
tree88838c967632934bc992ded67c223a835fd222ab /parse.c
parent8bee541c76ebea46ea1c809805270bb69595a56a (diff)
Deprecate arr[.field] for now
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/parse.c b/parse.c
index b92493a5..bbdb5f31 100644
--- a/parse.c
+++ b/parse.c
@@ -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");