aboutsummaryrefslogtreecommitdiff
path: root/src/parse.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-06 14:20:18 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-06 14:20:18 -0400
commit2bb2ff871fa1761478442bec5f6a32c9428360a1 (patch)
tree9b73df7a0c50c02353ae7bca7c2cd54788ef0077 /src/parse.c
parent59845e610f2c90474f34079d27b5f1e07071ded4 (diff)
Change method calls to use `foo.baz()` instead of `foo:baz()`
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/parse.c b/src/parse.c
index fa021e28..d686bb6d 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -847,8 +847,8 @@ PARSER(parse_reduction) {
ast_t *new_term;
progress = (false
|| (new_term=parse_index_suffix(ctx, key))
- || (new_term=parse_field_suffix(ctx, key))
|| (new_term=parse_method_call_suffix(ctx, key))
+ || (new_term=parse_field_suffix(ctx, key))
|| (new_term=parse_fncall_suffix(ctx, key))
|| (new_term=parse_optional_suffix(ctx, key))
|| (new_term=parse_non_optional_suffix(ctx, key))
@@ -1095,6 +1095,7 @@ PARSER(parse_heap_alloc) {
ast_t *new_term;
if ((new_term=parse_index_suffix(ctx, val))
|| (new_term=parse_fncall_suffix(ctx, val))
+ || (new_term=parse_method_call_suffix(ctx, val))
|| (new_term=parse_field_suffix(ctx, val))) {
val = new_term;
} else break;
@@ -1121,6 +1122,7 @@ PARSER(parse_stack_reference) {
ast_t *new_term;
if ((new_term=parse_index_suffix(ctx, val))
|| (new_term=parse_fncall_suffix(ctx, val))
+ || (new_term=parse_method_call_suffix(ctx, val))
|| (new_term=parse_field_suffix(ctx, val))) {
val = new_term;
} else break;
@@ -1462,8 +1464,8 @@ PARSER(parse_term) {
ast_t *new_term;
progress = (false
|| (new_term=parse_index_suffix(ctx, term))
- || (new_term=parse_field_suffix(ctx, term))
|| (new_term=parse_method_call_suffix(ctx, term))
+ || (new_term=parse_field_suffix(ctx, term))
|| (new_term=parse_fncall_suffix(ctx, term))
|| (new_term=parse_optional_suffix(ctx, term))
|| (new_term=parse_non_optional_suffix(ctx, term))
@@ -1479,7 +1481,7 @@ ast_t *parse_method_call_suffix(parse_ctx_t *ctx, ast_t *self) {
const char *start = self->start;
const char *pos = self->end;
- if (!match(&pos, ":")) return NULL;
+ if (!match(&pos, ".")) return NULL;
if (*pos == ' ') return NULL;
const char *fn = get_id(&pos);
if (!fn) return NULL;
@@ -1622,8 +1624,8 @@ static ast_t *parse_infix_expr(parse_ctx_t *ctx, const char *pos, int min_tightn
ast_t *new_term;
progress = (false
|| (new_term=parse_index_suffix(ctx, key))
- || (new_term=parse_field_suffix(ctx, key))
|| (new_term=parse_method_call_suffix(ctx, key))
+ || (new_term=parse_field_suffix(ctx, key))
|| (new_term=parse_fncall_suffix(ctx, key))
|| (new_term=parse_optional_suffix(ctx, key))
|| (new_term=parse_non_optional_suffix(ctx, key))