File tree Expand file tree Collapse file tree 3 files changed +13
-11
lines changed Expand file tree Collapse file tree 3 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -743,3 +743,13 @@ let is_rewritten_underscore_apply_sugar expr =
743
743
match expr.pexp_desc with
744
744
| Pexp_ident {txt = Longident. Lident "_" } -> true
745
745
| _ -> false
746
+
747
+ let is_tuple_array (expr : Parsetree.expression ) =
748
+ let is_plain_tuple (expr : Parsetree.expression ) =
749
+ match expr with
750
+ | {pexp_desc = Pexp_tuple _ } -> true
751
+ | _ -> false
752
+ in
753
+ match expr with
754
+ | {pexp_desc = Pexp_array items } -> List. for_all is_plain_tuple items
755
+ | _ -> false
Original file line number Diff line number Diff line change @@ -164,3 +164,5 @@ val has_if_let_attribute : Parsetree.attributes -> bool
164
164
val is_rewritten_underscore_apply_sugar : Parsetree .expression -> bool
165
165
166
166
val is_fun_newtype : Parsetree .expression -> bool
167
+
168
+ val is_tuple_array : Parsetree .expression -> bool
Original file line number Diff line number Diff line change @@ -429,16 +429,6 @@ let is_valid_numeric_polyvar_number (x : string) =
429
429
| _ -> false )
430
430
else a > = 48
431
431
432
- let is_tuple_array (expr : Parsetree.expression ) =
433
- let is_plain_tuple (expr : Parsetree.expression ) =
434
- match expr with
435
- | {pexp_desc = Pexp_tuple _ } -> true
436
- | _ -> false
437
- in
438
- match expr with
439
- | {pexp_desc = Pexp_array items } -> List. for_all is_plain_tuple items
440
- | _ -> false
441
-
442
432
(* Exotic identifiers in poly-vars have a "lighter" syntax: #"ease-in" *)
443
433
let print_poly_var_ident txt =
444
434
(* numeric poly-vars don't need quotes: #644 *)
@@ -4091,7 +4081,7 @@ and print_pexp_apply ~state expr cmt_tbl =
4091
4081
};
4092
4082
},
4093
4083
[(Nolabel , key_values)] )
4094
- when is_tuple_array key_values ->
4084
+ when Res_parsetree_viewer. is_tuple_array key_values ->
4095
4085
Doc. concat
4096
4086
[
4097
4087
Doc. text " dict{" ;
You can’t perform that action at this time.
0 commit comments