@@ -177,7 +177,7 @@ let expr_mapper ~async_context ~in_function_def (self : mapper)
177
177
(* module M = await Belt.List *)
178
178
| Pexp_letmodule
179
179
(lid, ({pmod_desc = Pmod_ident {txt}; pmod_attributes} as me), expr)
180
- when Res_parsetree_viewer. has_await_attribute pmod_attributes ->
180
+ when Res_parsetree_viewer. has_await_attribute2 pmod_attributes ->
181
181
let safe_module_type_lid : Ast_helper.lid =
182
182
{txt = Lident (local_module_type_name txt); loc = me.pmod_loc}
183
183
in
@@ -201,8 +201,8 @@ let expr_mapper ~async_context ~in_function_def (self : mapper)
201
201
pmod_attributes = attrs2;
202
202
} as me),
203
203
expr )
204
- when Res_parsetree_viewer. has_await_attribute attrs1
205
- || Res_parsetree_viewer. has_await_attribute attrs2 ->
204
+ when Res_parsetree_viewer. has_await_attribute2 attrs1
205
+ || Res_parsetree_viewer. has_await_attribute2 attrs2 ->
206
206
{
207
207
e with
208
208
pexp_desc =
@@ -242,10 +242,12 @@ let expr_mapper ~async_context ~in_function_def (self : mapper)
242
242
|| Ast_attributes. has_await_payload attrs2 ->
243
243
check_await () ;
244
244
result
245
- | _ when Ast_attributes. has_await_payload e.pexp_attributes ->
246
- check_await () ;
247
- Ast_await. create_await_expression result
248
- | _ -> result
245
+ | _ -> (
246
+ match result.pexp_desc with
247
+ | Pexp_await e ->
248
+ check_await () ;
249
+ Ast_await. create_await_expression e
250
+ | _ -> result)
249
251
250
252
let typ_mapper (self : mapper ) (typ : Parsetree.core_type ) =
251
253
Ast_core_type_class_type. typ_mapper self typ
@@ -493,7 +495,7 @@ let rec structure_mapper ~await_context (self : mapper) (stru : Ast_structure.t)
493
495
| Pstr_module
494
496
({pmb_expr = {pmod_desc = Pmod_ident {txt; loc}; pmod_attributes} as me}
495
497
as mb)
496
- when Res_parsetree_viewer. has_await_attribute pmod_attributes ->
498
+ when Res_parsetree_viewer. has_await_attribute2 pmod_attributes ->
497
499
let item = self.structure_item self item in
498
500
let safe_module_type_name = local_module_type_name txt in
499
501
let has_local_module_name =
@@ -544,7 +546,8 @@ let rec structure_mapper ~await_context (self : mapper) (stru : Ast_structure.t)
544
546
( _,
545
547
({pmod_desc = Pmod_ident {txt; loc}; pmod_attributes} as me),
546
548
expr )
547
- when Res_parsetree_viewer. has_await_attribute pmod_attributes -> (
549
+ when Res_parsetree_viewer. has_await_attribute2 pmod_attributes
550
+ -> (
548
551
let safe_module_type_name = local_module_type_name txt in
549
552
let has_local_module_name =
550
553
Hashtbl. find_opt ! await_context safe_module_type_name
0 commit comments