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 @@ -747,3 +747,13 @@ let isRewrittenUnderscoreApplySugar expr =
747
747
match expr.pexp_desc with
748
748
| Pexp_ident {txt = Longident. Lident "_" } -> true
749
749
| _ -> false
750
+
751
+ let isTupleArray (expr : Parsetree.expression ) =
752
+ let isPlainTuple (expr : Parsetree.expression ) =
753
+ match expr with
754
+ | {pexp_desc = Pexp_tuple _ } -> true
755
+ | _ -> false
756
+ in
757
+ match expr with
758
+ | {pexp_desc = Pexp_array items } -> List. for_all isPlainTuple items
759
+ | _ -> false
Original file line number Diff line number Diff line change @@ -170,3 +170,5 @@ val hasIfLetAttribute : Parsetree.attributes -> bool
170
170
val isRewrittenUnderscoreApplySugar : Parsetree .expression -> bool
171
171
172
172
val isFunNewtype : Parsetree .expression -> bool
173
+
174
+ val isTupleArray : Parsetree .expression -> bool
Original file line number Diff line number Diff line change @@ -427,16 +427,6 @@ let isValidNumericPolyvarNumber (x : string) =
427
427
| _ -> false )
428
428
else a > = 48
429
429
430
- let isTupleArray (expr : Parsetree.expression ) =
431
- let isPlainTuple (expr : Parsetree.expression ) =
432
- match expr with
433
- | {pexp_desc = Pexp_tuple _ } -> true
434
- | _ -> false
435
- in
436
- match expr with
437
- | {pexp_desc = Pexp_array items } -> List. for_all isPlainTuple items
438
- | _ -> false
439
-
440
430
(* Exotic identifiers in poly-vars have a "lighter" syntax: #"ease-in" *)
441
431
let printPolyVarIdent txt =
442
432
(* numeric poly-vars don't need quotes: #644 *)
@@ -4016,7 +4006,7 @@ and printPexpApply ~state expr cmtTbl =
4016
4006
};
4017
4007
},
4018
4008
[(Nolabel , keyValues)] )
4019
- when isTupleArray keyValues ->
4009
+ when Res_parsetree_viewer. isTupleArray keyValues ->
4020
4010
Doc. concat
4021
4011
[
4022
4012
Doc. text " dict{" ;
You can’t perform that action at this time.
0 commit comments