This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree 3 files changed +16
-6
lines changed
3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -55,10 +55,16 @@ let processUncurriedAttribute attrs =
55
55
in
56
56
process false [] attrs
57
57
58
+ type functionAttributesInfo = {
59
+ async : bool ;
60
+ uncurried : bool ;
61
+ attributes : Parsetree .attributes ;
62
+ }
63
+
58
64
let processFunctionAttributes attrs =
59
65
let rec process async uncurried acc attrs =
60
66
match attrs with
61
- | [] -> ( async, uncurried, List. rev acc)
67
+ | [] -> { async; uncurried; attributes = List. rev acc}
62
68
| ({Location. txt = "bs" } , _ ) :: rest -> process async true acc rest
63
69
| ({Location. txt = "async" } , _ ) :: rest -> process true uncurried acc rest
64
70
| attr :: rest -> process async uncurried (attr :: acc) rest
Original file line number Diff line number Diff line change @@ -17,10 +17,14 @@ val functorType :
17
17
val processUncurriedAttribute :
18
18
Parsetree .attributes -> bool * Parsetree .attributes
19
19
20
+ type functionAttributesInfo = {
21
+ async : bool ;
22
+ uncurried : bool ;
23
+ attributes : Parsetree .attributes ;
24
+ }
25
+
20
26
(* determines whether a function is async and/or uncurried based on the given attributes *)
21
- val processFunctionAttributes :
22
- Parsetree .attributes ->
23
- bool (* async *) * bool (* uncurried *) * Parsetree .attributes
27
+ val processFunctionAttributes : Parsetree .attributes -> functionAttributesInfo
24
28
25
29
val hasAwaitAttribute : Parsetree .attributes -> bool
26
30
Original file line number Diff line number Diff line change @@ -3135,7 +3135,7 @@ and printExpression ~customLayout (e : Parsetree.expression) cmtTbl =
3135
3135
cmtTbl
3136
3136
| Pexp_fun _ | Pexp_newtype _ ->
3137
3137
let attrsOnArrow, parameters, returnExpr = ParsetreeViewer. funExpr e in
3138
- let async, uncurried, attrs =
3138
+ let ParsetreeViewer. { async; uncurried; attributes = attrs} =
3139
3139
ParsetreeViewer. processFunctionAttributes attrsOnArrow
3140
3140
in
3141
3141
let returnExpr, typConstraint =
@@ -3302,7 +3302,7 @@ and printExpression ~customLayout (e : Parsetree.expression) cmtTbl =
3302
3302
3303
3303
and printPexpFun ~customLayout ~inCallback e cmtTbl =
3304
3304
let attrsOnArrow, parameters, returnExpr = ParsetreeViewer. funExpr e in
3305
- let async, uncurried, attrs =
3305
+ let ParsetreeViewer. { async; uncurried; attributes = attrs} =
3306
3306
ParsetreeViewer. processFunctionAttributes attrsOnArrow
3307
3307
in
3308
3308
let returnExpr, typConstraint =
You can’t perform that action at this time.
0 commit comments