diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-09-21 18:01:19 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-09-21 18:01:19 -0400 |
| commit | 68bedd3c23757a8576e77f38e38ddcf9ecd26d19 (patch) | |
| tree | 86ce1610143efc43453f50d3413925797601c48a /src/parse/types.c | |
| parent | 0815de981c683cac7dbac082ee14c11894089f31 (diff) | |
Use colons instead of '=' for tables (e.g. {1: 2})
Diffstat (limited to 'src/parse/types.c')
| -rw-r--r-- | src/parse/types.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/parse/types.c b/src/parse/types.c index f08578e9..192103dc 100644 --- a/src/parse/types.c +++ b/src/parse/types.c @@ -25,15 +25,14 @@ type_ast_t *parse_table_type(parse_ctx_t *ctx, const char *pos) { pos = key_type->end; whitespace(ctx, &pos); type_ast_t *value_type = NULL; - if (match(&pos, "=")) { + if (match(&pos, ":")) { value_type = expect(ctx, start, &pos, parse_type, "I couldn't parse the rest of this table type"); } else { return NULL; } spaces(&pos); ast_t *default_value = NULL; - if (match(&pos, ";") && match_word(&pos, "default")) { - expect_str(ctx, pos, &pos, "=", "I expected an '=' here"); + if (match(&pos, "=")) { default_value = expect(ctx, start, &pos, parse_extended_expr, "I couldn't parse the default value for this table"); } |
