Skip to content

Commit 08988ca

Browse files
authored
flambda-backend: Fix labeled tuple pattern location in parser, again. (#2637)
1 parent 4e57670 commit 08988ca

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

parsing/parser.mly

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3529,10 +3529,12 @@ pattern_no_exn:
35293529
{ let loc = $loc(label) in
35303530
Some label, mkpatvar ~loc label }
35313531
| TILDE LPAREN label = LIDENT COLON cty = core_type RPAREN %prec COMMA
3532-
{ let loc = $loc(label) in
3533-
let pat = mkpatvar ~loc label in
3534-
Some label, mkpat_opt_constraint ~loc pat (Some cty) }
3532+
{ let lbl_loc = $loc(label) in
3533+
let pat_loc = $startpos($2), $endpos in
3534+
let pat = mkpatvar ~loc:lbl_loc label in
3535+
Some label, mkpat_opt_constraint ~loc:pat_loc pat (Some cty) }
35353536

3537+
(* If changing this, don't forget to change its copy just above. *)
35363538
%inline labeled_tuple_pat_element_noprec(self):
35373539
| self { None, $1 }
35383540
| LABEL simple_pattern

0 commit comments

Comments
 (0)