File tree 5 files changed +9
-13
lines changed
5 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -166,14 +166,8 @@ let is_inline : attr -> bool =
166
166
167
167
let has_inline_payload (attrs : t ) = Ext_list. find_first attrs is_inline
168
168
169
- let is_await : attr -> bool =
170
- fun ({txt} , _ ) -> txt = " await" || txt = " res.await"
171
-
172
- let is_async : attr -> bool =
173
- fun ({txt} , _ ) -> txt = " async" || txt = " res.async"
174
-
175
- let has_await_payload (attrs : t ) = Ext_list. find_first attrs is_await
176
- let has_async_payload (attrs : t ) = Ext_list. find_first attrs is_async
169
+ let has_await_payload (attrs : t ) = Ext_list. find_first attrs Ast_await. is_await
170
+ let has_async_payload (attrs : t ) = Ext_list. find_first attrs Ast_async. is_async
177
171
178
172
type derive_attr = {bs_deriving : Ast_payload .action list option } [@@ unboxed]
179
173
Original file line number Diff line number Diff line change
1
+ let is_async : Parsetree.attribute -> bool =
2
+ fun ({txt} , _ ) -> txt = " async" || txt = " res.async"
3
+
1
4
let add_promise_type ?(loc = Location. none) ~async
2
5
(result : Parsetree.expression ) =
3
6
if async then
Original file line number Diff line number Diff line change
1
+ let is_await : Parsetree.attribute -> bool =
2
+ fun ({txt} , _ ) -> txt = " await" || txt = " res.await"
3
+
1
4
let create_await_expression (e : Parsetree.expression ) =
2
5
let loc = e.pexp_loc in
3
6
let unsafe_await =
Original file line number Diff line number Diff line change @@ -64,9 +64,6 @@ let removeArity binding =
64
64
in
65
65
{binding with pvb_expr = removeArityRecord binding.pvb_expr}
66
66
67
- let is_async : Parsetree.attribute -> bool =
68
- fun ({txt} , _ ) -> txt = " async" || txt = " res.async"
69
-
70
67
let async_component ~async expr =
71
68
if async then
72
69
let open Ast_helper in
Original file line number Diff line number Diff line change @@ -910,8 +910,7 @@ let mapBinding ~config ~emptyLoc ~pstr_loc ~fileName ~recFlag binding =
910
910
modifiedBinding ~binding Loc ~binding PatLoc ~fn Name binding
911
911
in
912
912
let isAsync =
913
- Ext_list. find_first binding.pvb_expr.pexp_attributes
914
- React_jsx_common. is_async
913
+ Ext_list. find_first binding.pvb_expr.pexp_attributes Ast_async. is_async
915
914
|> Option. is_some
916
915
in
917
916
(* do stuff here! *)
You can’t perform that action at this time.
0 commit comments