From ee7246541bba44efcb6d2c0d8bd3178c91940fff Mon Sep 17 00:00:00 2001 From: Tobias Mock Date: Wed, 11 Sep 2024 22:08:56 +0200 Subject: [PATCH] Improve error location for non-exhaustive matches --- lib/parser.mly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/parser.mly b/lib/parser.mly index 778866e3..4272388c 100644 --- a/lib/parser.mly +++ b/lib/parser.mly @@ -330,7 +330,7 @@ expr_no_ident: { let arg = {apass = pass_attr_of_opt None; aexpr; aloc = $loc(aexpr)} in Pipe_tail ($loc, arg, Pip_expr pipeable) } | Match; expr = passed(expr); Lcurly; option(Hbar); clauses = clauses; Rcurly - { Match ($loc, fst expr, snd expr, clauses) } + { Match (($startpos, $endpos(expr)), fst expr, snd expr, clauses) } | Ampersand; expr = expr; Equal; newval = expr; %prec Below_Ampersand { Set ($loc, ($loc(expr), expr), newval) } | id = Path_id; expr = expr; %prec Path { Local_use ($loc, id, expr) }