Skip to content

Commit ef4983f

Browse files
authored
Misc: Bump ocamlformat from 0.27.0 to 0.28.1 (#2119)
Signed-off-by: Sora Morimoto <[email protected]>
1 parent c5bfc46 commit ef4983f

File tree

32 files changed

+241
-251
lines changed

32 files changed

+241
-251
lines changed

.ocamlformat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ dock-collection-brackets=false
1111
margin=90
1212
module-item-spacing=sparse
1313
parse-docstrings=false
14-
version=0.27.0
15-
ocaml-version=4.08.0
14+
version=0.28.1
15+
ocaml-version=4.13.0

benchmarks/common.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ end = struct
228228
Sys.readdir dir
229229
|> Array.to_list
230230
|> List.filter ~f:(fun nm ->
231-
let open Unix in
232-
match stat (dir ^ "/" ^ nm) with
233-
| { st_kind = S_REG | S_LNK; _ } -> true
234-
| _ -> false)
231+
let open Unix in
232+
match stat (dir ^ "/" ^ nm) with
233+
| { st_kind = S_REG | S_LNK; _ } -> true
234+
| _ -> false)
235235
|> (if spec.ext = ""
236236
then fun x -> x
237237
else

benchmarks/run.ml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,13 @@ let _ =
229229
| reports ->
230230
List.map reports ~f:read_report_config
231231
|> List.concat_map ~f:(fun l ->
232-
List.concat_map l ~f:(fun l ->
233-
List.concat_map l ~f:(function
234-
| None -> []
235-
| Some (p1, p2, _measure, _) -> (
236-
match String.split_on_char ~sep:'/' p1 with
237-
| [ "results"; "times"; _host; interpreter ] ->
238-
[ interpreter, p2 ]
239-
| _ -> []))))
232+
List.concat_map l ~f:(fun l ->
233+
List.concat_map l ~f:(function
234+
| None -> []
235+
| Some (p1, p2, _measure, _) -> (
236+
match String.split_on_char ~sep:'/' p1 with
237+
| [ "results"; "times"; _host; interpreter ] -> [ interpreter, p2 ]
238+
| _ -> []))))
240239
|> List.sort_uniq ~cmp:compare
241240
|> fun required ->
242241
true, fun (interp, suite) -> List.mem (interp, Spec.name suite) ~set:required

compiler/bin-js_of_ocaml/check_runtime.ml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ open Js_of_ocaml_compiler
2323
let group_by_snd l =
2424
l
2525
|> List.sort_uniq ~cmp:(fun (n1, l1) (n2, l2) ->
26-
match List.compare ~cmp:String.compare l1 l2 with
27-
| 0 -> String.compare n1 n2
28-
| c -> c)
26+
match List.compare ~cmp:String.compare l1 l2 with
27+
| 0 -> String.compare n1 n2
28+
| c -> c)
2929
|> List.group ~f:(fun (_, g1) (_, g2) -> List.equal ~eq:String.equal g1 g2)
3030

3131
let print_groups output l =
@@ -131,10 +131,10 @@ let f (runtime_files, bytecode, target_env) =
131131
let extra =
132132
extra
133133
|> List.map ~f:(fun name ->
134-
( (name ^ if Linker.deprecated ~name then " (deprecated)" else "")
135-
, match Linker.origin ~name with
136-
| None -> []
137-
| Some x -> [ x ] ))
134+
( (name ^ if Linker.deprecated ~name then " (deprecated)" else "")
135+
, match Linker.origin ~name with
136+
| None -> []
137+
| Some x -> [ x ] ))
138138
|> group_by_snd
139139
in
140140

compiler/bin-js_of_ocaml/js_of_ocaml.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ let () =
3030
String.length x > 0
3131
&& (not (Char.equal x.[0] '-'))
3232
&& String.for_all x ~f:(function
33-
| 'a' .. 'z' | 'A' .. 'Z' | '-' -> true
34-
| _ -> false)
33+
| 'a' .. 'z' | 'A' .. 'Z' | '-' -> true
34+
| _ -> false)
3535
in
3636
match Array.to_list argv with
3737
| exe :: maybe_command :: rest ->

compiler/bin-wasm_of_ocaml/compile.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ let merge_shape a b =
342342
let sexp_of_shapes s =
343343
StringMap.bindings s
344344
|> List.map ~f:(fun (name, shape) ->
345-
Sexp.List [ Atom name; Atom (Shape.to_string shape) ])
345+
Sexp.List [ Atom name; Atom (Shape.to_string shape) ])
346346

347347
let string_of_shapes s = Sexp.List (sexp_of_shapes s) |> Sexp.to_string
348348

@@ -476,7 +476,7 @@ let run
476476
tmp_wasm_file
477477
|> (fun file -> Link.Wasm_binary.read_imports ~file)
478478
|> List.filter_map ~f:(fun { Link.Wasm_binary.module_; name; _ } ->
479-
if String.equal module_ "js" then Some name else None)
479+
if String.equal module_ "js" then Some name else None)
480480
|> StringSet.of_list
481481
in
482482
let js_runtime = build_js_runtime ~primitives () in

compiler/bin-wasm_of_ocaml/wasm_of_ocaml.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ let () =
2828
String.length x > 0
2929
&& (not (Char.equal x.[0] '-'))
3030
&& String.for_all x ~f:(function
31-
| 'a' .. 'z' | 'A' .. 'Z' | '-' -> true
32-
| _ -> false)
31+
| 'a' .. 'z' | 'A' .. 'Z' | '-' -> true
32+
| _ -> false)
3333
in
3434
match Array.to_list argv with
3535
| exe :: maybe_command :: rest ->

compiler/lib-wasm/link.ml

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -357,25 +357,23 @@ let info_from_sexp info =
357357
|> member "units"
358358
|> Option.value ~default:[]
359359
|> List.map ~f:(fun u ->
360-
let unit_info = u |> Unit_info.from_sexp in
361-
let unit_name =
362-
u |> member "name" |> Option.value ~default:[] |> single string
363-
in
364-
let fragments =
365-
u
366-
|> member "fragments"
367-
|> Option.map ~f:(single string)
368-
|> Option.map ~f:(fun s -> Marshal.from_string (Base64.decode_exn s) 0)
369-
|> Option.value ~default:[]
370-
(*
360+
let unit_info = u |> Unit_info.from_sexp in
361+
let unit_name = u |> member "name" |> Option.value ~default:[] |> single string in
362+
let fragments =
363+
u
364+
|> member "fragments"
365+
|> Option.map ~f:(single string)
366+
|> Option.map ~f:(fun s -> Marshal.from_string (Base64.decode_exn s) 0)
367+
|> Option.value ~default:[]
368+
(*
371369
|> to_option to_assoc
372370
|> Option.value ~default:[]
373371
|> List.map ~f:(fun (nm, e) ->
374372
( nm
375373
, let lex = Parse_js.Lexer.of_string (to_string e) in
376374
Parse_js.parse_expr lex ))*)
377-
in
378-
{ unit_name; unit_info; fragments })
375+
in
376+
{ unit_name; unit_info; fragments })
379377
in
380378
build_info, predefined_exceptions, unit_data
381379

@@ -591,15 +589,15 @@ let link_to_directory ~files_to_link ~files ~enable_source_maps ~dir =
591589
let lst =
592590
List.tl files
593591
|> List.map ~f:(fun (file, _) ->
594-
if StringSet.mem file files_to_link
595-
then (
596-
let z = Zip.open_in file in
597-
let name' = file |> Filename.basename |> Filename.remove_extension in
598-
let ((name', _) as res) = process_file z ~name:"code" ~name' in
599-
if enable_source_maps then extract_source_map ~dir ~name:name' z;
600-
Zip.close_in z;
601-
Some res)
602-
else None)
592+
if StringSet.mem file files_to_link
593+
then (
594+
let z = Zip.open_in file in
595+
let name' = file |> Filename.basename |> Filename.remove_extension in
596+
let ((name', _) as res) = process_file z ~name:"code" ~name' in
597+
if enable_source_maps then extract_source_map ~dir ~name:name' z;
598+
Zip.close_in z;
599+
Some res)
600+
else None)
603601
|> List.filter_map ~f:(fun x -> x)
604602
in
605603
runtime :: prelude :: List.map ~f:fst lst, (runtime_intf, List.map ~f:snd lst)
@@ -653,10 +651,10 @@ let load_information files =
653651
( predefined_exceptions
654652
, (runtime, (build_info, []))
655653
:: List.map other_files ~f:(fun file ->
656-
let build_info, _predefined_exceptions, unit_data =
657-
Zip.with_open_in file read_info
658-
in
659-
file, (build_info, unit_data)) )
654+
let build_info, _predefined_exceptions, unit_data =
655+
Zip.with_open_in file read_info
656+
in
657+
file, (build_info, unit_data)) )
660658

661659
let remove_directory path =
662660
try
@@ -801,8 +799,7 @@ let link ~output_file ~linkall ~enable_source_maps ~files =
801799
let generated_js =
802800
List.concat
803801
@@ List.map files ~f:(fun (_, (_, units)) ->
804-
List.map units ~f:(fun { unit_name; fragments; _ } ->
805-
Some unit_name, fragments))
802+
List.map units ~f:(fun { unit_name; fragments; _ } -> Some unit_name, fragments))
806803
in
807804
let runtime_args =
808805
let js =

compiler/lib-wasm/wasm_link.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,9 @@ module Read = struct
540540
{ final = f2; supertype = s2; typ = t2 } =
541541
Bool.(f1 = f2)
542542
&& (match s1, s2 with
543-
| Some _, None | None, Some _ -> false
544-
| None, None -> true
545-
| Some i1, Some i2 -> i1 = i2)
543+
| Some _, None | None, Some _ -> false
544+
| None, None -> true
545+
| Some i1, Some i2 -> i1 = i2)
546546
&& comptype_eq t1 t2
547547

548548
let equal t1 t2 =

compiler/lib-wasm/wat_output.ml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,13 @@ let value_type_list st name tl =
196196

197197
let func_type st ?param_names { params; result } =
198198
(match param_names with
199-
| None -> value_type_list st "param" params
200-
| Some names ->
201-
List.map2
202-
~f:(fun i typ -> List [ Atom "param"; index st.local_names i; value_type st typ ])
203-
names
204-
params)
199+
| None -> value_type_list st "param" params
200+
| Some names ->
201+
List.map2
202+
~f:(fun i typ ->
203+
List [ Atom "param"; index st.local_names i; value_type st typ ])
204+
names
205+
params)
205206
@ value_type_list st "result" result
206207

207208
let storage_type st typ =
@@ -234,10 +235,10 @@ let export name =
234235

235236
let type_prefix op nm =
236237
(match op with
237-
| I32 _ -> "i32."
238-
| I64 _ -> "i64."
239-
| F32 _ -> "f32."
240-
| F64 _ -> "f64.")
238+
| I32 _ -> "i32."
239+
| I64 _ -> "i64."
240+
| F32 _ -> "f32."
241+
| F64 _ -> "f64.")
241242
^ nm
242243

243244
let signage op (s : Wasm_ast.signage) =

0 commit comments

Comments
 (0)