From 6ae27d409a259f47a317c25adf4e0bab0edbddb4 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 8 Oct 2024 21:46:03 -0400 Subject: Better message --- parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse.c b/parse.c index d365fc4b..4001d4b8 100644 --- a/parse.c +++ b/parse.c @@ -1005,7 +1005,7 @@ PARSER(parse_reduction) { ast_t *fallback = NULL; if (match_word(&pos, "else")) { - expect_str(ctx, start, &pos, ":", "I expected a ':' here"); + expect_str(ctx, pos-strlen("else"), &pos, ":", "I expected a ':' for this 'else'"); fallback = expect(ctx, pos-4, &pos, parse_expr, "I couldn't parse the expression after this 'else'"); } -- cgit v1.2.3