Skip to content

Commit 1043b35

Browse files
committed
more clean up
1 parent de87f41 commit 1043b35

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

jscomp/frontend/bs_builtin_ppx.ml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -578,28 +578,29 @@ let rec structure_mapper ~await_context (self : mapper) (stru : Ast_structure.t)
578578
vbs
579579
|> List.filter_map (fun ({pvb_expr} : Parsetree.value_binding) ->
580580
match pvb_expr.pexp_desc with
581-
| Pexp_letmodule (_, ({pmod_attributes} as me), _)
581+
| Pexp_letmodule
582+
( _,
583+
({pmod_desc = Pmod_ident {txt; loc}; pmod_attributes} as
584+
me),
585+
_ )
582586
when Res_parsetree_viewer.hasAwaitAttribute pmod_attributes
583587
-> (
584-
match me.pmod_desc with
585-
| Pmod_ident {txt; loc} -> (
586-
let safe_module_type_name = local_module_type_name txt in
587-
let has_local_module_name =
588-
Hashtbl.find_opt !await_context safe_module_type_name
589-
in
588+
let safe_module_type_name = local_module_type_name txt in
589+
let has_local_module_name =
590+
Hashtbl.find_opt !await_context safe_module_type_name
591+
in
590592

591-
match has_local_module_name with
592-
| Some _ -> None
593-
| None ->
594-
Hashtbl.add !await_context safe_module_type_name
595-
safe_module_type_name;
596-
Some
597-
Ast_helper.(
598-
Str.modtype ~loc
599-
(Mtd.mk ~loc
600-
{txt = safe_module_type_name; loc}
601-
~typ:(Mty.typeof_ ~loc me))))
602-
| _ -> None)
593+
match has_local_module_name with
594+
| Some _ -> None
595+
| None ->
596+
Hashtbl.add !await_context safe_module_type_name
597+
safe_module_type_name;
598+
Some
599+
Ast_helper.(
600+
Str.modtype ~loc
601+
(Mtd.mk ~loc
602+
{txt = safe_module_type_name; loc}
603+
~typ:(Mty.typeof_ ~loc me))))
603604
| _ -> None)
604605
in
605606

0 commit comments

Comments
 (0)