This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-15
lines changed
tests/parsing/grammar/expressions Expand file tree Collapse file tree 3 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -3082,25 +3082,20 @@ and parseExprBlockItem p =
3082
3082
match letBindings with
3083
3083
| [
3084
3084
{
3085
- pvb_pat =
3086
- {
3087
- ppat_desc =
3088
- Ppat_construct
3089
- ({txt = Lident " Some" }, Some ({ppat_desc = Ppat_var _} as pat));
3090
- };
3085
+ pvb_pat = {ppat_desc = Ppat_construct ({txt = Lident " Some" }, Some pat)};
3091
3086
pvb_expr;
3092
3087
};
3093
3088
]
3094
3089
when recFlag = Nonrecursive ->
3095
3090
let lid_none = Location. mknoloc (Longident. Lident " None" ) in
3096
- let pat_none = Ast_helper.Pat. construct lid_none None in
3091
+ let pat_any = Ast_helper.Pat. any () in
3097
3092
let exp_none = Ast_helper.Exp. construct lid_none None in
3098
- let case_none = Ast_helper.Exp. case pat_none exp_none in
3093
+ let case_any = Ast_helper.Exp. case pat_any exp_none in
3099
3094
let lid_some = Location. mknoloc (Longident. Lident " Some" ) in
3100
3095
let pat_some = Ast_helper.Pat. construct lid_some (Some pat) in
3101
3096
let case_some = Ast_helper.Exp. case pat_some next in
3102
3097
let match_exp =
3103
- Ast_helper.Exp. match_ ~loc pvb_expr [case_none; case_some ]
3098
+ Ast_helper.Exp. match_ ~loc pvb_expr [case_some; case_any ]
3104
3099
in
3105
3100
match_exp
3106
3101
| _ -> Ast_helper.Exp. let_ ~loc recFlag letBindings next
Original file line number Diff line number Diff line change 1
1
let foo = (x , y ) => {
2
2
let Some (vx ) = x
3
- let x1 = vx + 1
4
- let Some (vy ) = y
5
- let y1 = vy + 1
3
+ let x1 = vx + 1
4
+ let Some ({ vy , vz : 3 } ) = y
5
+ let y1 = vy + 1
6
6
Some (x1 + y1 )
7
7
}
Original file line number Diff line number Diff line change 1
1
let foo x y =
2
2
((match x with
3
- | None -> None
4
3
| Some vx ->
5
4
let x1 = vx + 1 in
6
5
(match y with
7
- | None -> None
8
- | Some vy -> let y1 = vy + 1 in Some (x1 + y1)))
6
+ | Some { vy; vz = 3 } -> let y1 = vy + 1 in Some (x1 + y1)
7
+ | _ -> None)
8
+ | _ -> None)
9
9
[@ns.braces ])
You can’t perform that action at this time.
0 commit comments