Skip to content

Commit 7129a5d

Browse files
committed
dune fmt
1 parent f7f41eb commit 7129a5d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1243
-630
lines changed

jscomp/frontend/ast_derive_js_mapper.ml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ let init () =
219219
else Exp.constraint_ obj_exp core_type))
220220
in
221221
let rest = [to_js; from_js] in
222-
if create_type then erase_type_str :: new_type_str :: rest else rest
222+
if create_type then erase_type_str :: new_type_str :: rest
223+
else rest
223224
| Ptype_abstract -> (
224225
match Ast_polyvar.is_enum_polyvar tdcl with
225226
| Some row_fields ->
@@ -243,7 +244,8 @@ let init () =
243244
( {txt = "raw"; loc},
244245
PStr
245246
[
246-
Str.eval (Exp.constant (Const.string rev_data));
247+
Str.eval
248+
(Exp.constant (Const.string rev_data));
247249
] )
248250
else exp_map);
249251
to_js_body
@@ -303,7 +305,8 @@ let init () =
303305
in
304306
new_type_str
305307
+? [
306-
to_js_type (if create_type then new_type else obj_type Closed);
308+
to_js_type
309+
(if create_type then new_type else obj_type Closed);
307310
Ast_comb.single_non_rec_val pat_from_js
308311
((if create_type then new_type else obj_type Open)
309312
->~ core_type);

jscomp/frontend/ast_tdcls.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ let handle_tdcls_in_sigi (self : Bs_ast_mapper.mapper)
5151
let kind = Ast_derive_abstract.is_abstract actions in
5252
if kind <> Not_abstract then
5353
let codes =
54-
Ast_derive_abstract.handle_tdcls_in_sig ~light:(kind = Light_abstract) rf
55-
original_tdcls_new_attrs
54+
Ast_derive_abstract.handle_tdcls_in_sig ~light:(kind = Light_abstract)
55+
rf original_tdcls_new_attrs
5656
in
5757
Ast_signature.fuse_all ~loc
5858
(Sig.include_ ~loc
@@ -87,8 +87,8 @@ let handle_tdcls_in_stru (self : Bs_ast_mapper.mapper)
8787
let kind = Ast_derive_abstract.is_abstract actions in
8888
if kind <> Not_abstract then
8989
let codes =
90-
Ast_derive_abstract.handle_tdcls_in_str ~light:(kind = Light_abstract) rf
91-
original_tdcls_new_attrs
90+
Ast_derive_abstract.handle_tdcls_in_str ~light:(kind = Light_abstract)
91+
rf original_tdcls_new_attrs
9292
in
9393
(* use [tdcls2] avoid nonterminating *)
9494
Ast_structure.fuse_all ~loc

jscomp/gentype/Annotation.ml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,17 @@ let get_as_int attributes =
136136
| _ -> None
137137

138138
let get_attribute_import_renaming attributes =
139-
let attribute_import = attributes |> get_attribute_payload tag_is_gen_type_import in
139+
let attribute_import =
140+
attributes |> get_attribute_payload tag_is_gen_type_import
141+
in
140142
let gen_type_as_renaming = attributes |> get_gen_type_as_renaming in
141143
match (attribute_import, gen_type_as_renaming) with
142144
| Some (_, StringPayload import_string), _ ->
143145
(Some import_string, gen_type_as_renaming)
144146
| ( Some
145147
( _,
146-
TuplePayload [StringPayload import_string; StringPayload rename_string]
147-
),
148+
TuplePayload
149+
[StringPayload import_string; StringPayload rename_string] ),
148150
_ ) ->
149151
(Some import_string, Some rename_string)
150152
| _ -> (None, gen_type_as_renaming)
@@ -169,7 +171,10 @@ let from_attributes ~(config : GenTypeConfig.t) ~loc
169171
(attributes : Typedtree.attributes) =
170172
let default = if config.everything then GenType else NoGenType in
171173
if has_attribute tag_is_gen_type_opaque attributes then GenTypeOpaque
172-
else if has_attribute (fun s -> tag_is_gen_type s || tag_is_gen_type_as s) attributes
174+
else if
175+
has_attribute
176+
(fun s -> tag_is_gen_type s || tag_is_gen_type_as s)
177+
attributes
173178
then (
174179
(match attributes |> get_attribute_payload tag_is_gen_type with
175180
| Some (_, UnrecognizedPayload) -> ()
@@ -226,8 +231,8 @@ and signature_item_check_annotation ~check_annotation
226231
| Tsig_include _ | Tsig_class _ | Tsig_class_type _ ->
227232
false
228233

229-
and signature_check_annotation ~check_annotation (signature : Typedtree.signature)
230-
=
234+
and signature_check_annotation ~check_annotation
235+
(signature : Typedtree.signature) =
231236
signature.sig_items
232237
|> List.exists (signature_item_check_annotation ~check_annotation)
233238

@@ -283,8 +288,8 @@ and module_binding_check_annotation ~check_annotation
283288
mb_attributes |> check_annotation ~loc
284289
|| mb_expr |> module_expr_check_annotation ~check_annotation
285290

286-
and structure_check_annotation ~check_annotation (structure : Typedtree.structure)
287-
=
291+
and structure_check_annotation ~check_annotation
292+
(structure : Typedtree.structure) =
288293
structure.str_items
289294
|> List.exists (structure_item_check_annotation ~check_annotation)
290295

jscomp/gentype/Converter.ml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ let type_get_inlined ~config ~lookup_id ~type_name_is_interface type0 =
1010
Array (t_normalized, mutable_)
1111
| Dict _ -> normalized_
1212
| Function ({arg_types; ret_type} as function_) ->
13-
let arg_converted = arg_types |> List.map (arg_type_to_grouped_arg ~visited) in
13+
let arg_converted =
14+
arg_types |> List.map (arg_type_to_grouped_arg ~visited)
15+
in
1416
let ret_normalized = ret_type |> visit ~visited in
15-
Function {function_ with arg_types = arg_converted; ret_type = ret_normalized}
17+
Function
18+
{function_ with arg_types = arg_converted; ret_type = ret_normalized}
1619
| Ident {builtin = true} -> normalized_
1720
| Ident {builtin = false; name; type_args} -> (
1821
if visited |> StringSet.mem name then (
@@ -37,7 +40,9 @@ let type_get_inlined ~config ~lookup_id ~type_name_is_interface type0 =
3740
let inlined = type_ |> TypeVars.substitute ~f |> visit ~visited in
3841
inlined
3942
| exception Not_found ->
40-
let type_args = type_args |> List.map (fun t -> t |> visit ~visited) in
43+
let type_args =
44+
type_args |> List.map (fun t -> t |> visit ~visited)
45+
in
4146
Ident {builtin = false; name; type_args})
4247
| Null t ->
4348
let t_normalized = t |> visit ~visited in

jscomp/gentype/Dependencies.ml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,19 @@ let rec fromPath1 ~config ~type_env (path : Path.t) =
2121
match typeEnv1 |> TypeEnv.expand_alias_to_external_module ~name with
2222
| Some dep -> (typeEnv2, dep)
2323
| None ->
24-
let resolved_name = name |> TypeEnv.add_module_path ~type_env:typeEnv1 in
24+
let resolved_name =
25+
name |> TypeEnv.add_module_path ~type_env:typeEnv1
26+
in
2527
(typeEnv2, Internal resolved_name)))
26-
| Pdot (Pident id, s, _pos) when id |> ScopedPackage.is_generated_module ~config
27-
->
28+
| Pdot (Pident id, s, _pos)
29+
when id |> ScopedPackage.is_generated_module ~config ->
2830
( type_env,
2931
External (s |> ScopedPackage.add_generated_module ~generated_module:id) )
3032
| Pdot (p, s, _pos) -> (
3133
let type_env_from_p, dep = p |> fromPath1 ~config ~type_env in
32-
match type_env_from_p |> TypeEnv.expand_alias_to_external_module ~name:s with
34+
match
35+
type_env_from_p |> TypeEnv.expand_alias_to_external_module ~name:s
36+
with
3337
| Some dep -> (type_env_from_p, dep)
3438
| None -> (type_env_from_p, Dot (dep, s)))
3539
| Papply _ ->

0 commit comments

Comments
 (0)