aboutsummaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-03-03 17:21:55 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-03-03 17:21:55 -0500
commit2eafa7a4da020ca6a6ddfd29c70cc8c1f41493a3 (patch)
tree41fc984811b93c9f439ade60e8f9a86e28c236dd /parse.c
parentc607b97732c9922aa6fef3a0fe1055b028d5f0c2 (diff)
Fix issue with unnamed args getting name flag
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/parse.c b/parse.c
index b349bcb3..19a3a288 100644
--- a/parse.c
+++ b/parse.c
@@ -1177,8 +1177,10 @@ ast_t *parse_method_call_suffix(parse_ctx_t *ctx, ast_t *self) {
const char *arg_start = pos;
const char *name = get_id(&pos);
whitespace(&pos);
- if (!name || !match(&pos, "="))
+ if (!name || !match(&pos, "=")) {
+ name = NULL;
pos = arg_start;
+ }
ast_t *arg = optional(ctx, &pos, parse_expr);
if (!arg) {
@@ -1214,8 +1216,10 @@ ast_t *parse_fncall_suffix(parse_ctx_t *ctx, ast_t *fn, bool is_extern) {
const char *arg_start = pos;
const char *name = get_id(&pos);
whitespace(&pos);
- if (!name || !match(&pos, "="))
+ if (!name || !match(&pos, "=")) {
+ name = NULL;
pos = arg_start;
+ }
ast_t *arg = optional(ctx, &pos, parse_expr);
if (!arg) {