Skip to content

Commit bdf3d62

Browse files
committed
remove unused code
1 parent 5298392 commit bdf3d62

17 files changed

+598800
-599152
lines changed

jscomp/bsb/bsb_parse_sources.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,11 @@ let prune_staled_bs_js_files
238238
let lazy cmd = bs_cmt_post_process_cmd in
239239

240240
if cmd <> "" then
241-
Ext_pervasives.try_it (fun _ ->
241+
(try ignore (
242242
Sys.command (
243243
cmd ^
244244
" -cmt-rm " ^ filepath)
245-
)
245+
: int ) with _ -> ())
246246
| Cmj _ ->
247247
(* remove .bs.js *)
248248
if context.bs_suffix then
@@ -492,13 +492,13 @@ let clean_re_js root =
492492
| None -> Set_string.empty
493493
in
494494
Ext_option.iter (Map_string.find_opt map Bsb_build_schemas.sources) begin fun config ->
495-
Ext_pervasives.try_it (fun () ->
495+
try (
496496
walk_sources { root ;
497497
traverse = true;
498498
cwd = Filename.current_dir_name;
499499
ignored_dirs
500500
} config
501-
)
501+
) with _ -> ()
502502
end
503503
| _ -> ()
504504
| exception _ -> ()

jscomp/ext/ext_pervasives.ml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ let finally v ~clean:action f =
3636
reraise e
3737
| e -> action v ; e
3838

39-
let try_it f =
40-
try ignore (f ()) with _ -> ()
39+
(* let try_it f =
40+
try ignore (f ()) with _ -> () *)
4141

4242
let with_file_as_chan filename f =
4343
finally (open_out_bin filename) ~clean:close_out f
@@ -47,9 +47,9 @@ let with_file_as_chan filename f =
4747

4848

4949

50-
external id : 'a -> 'a = "%identity"
51-
50+
(* external id : 'a -> 'a = "%identity" *)
5251

52+
(*
5353
let hash_variant s =
5454
let accu = ref 0 in
5555
for i = 0 to String.length s - 1 do
@@ -58,11 +58,11 @@ let hash_variant s =
5858
(* reduce to 31 bits *)
5959
accu := !accu land (1 lsl 31 - 1);
6060
(* make it signed for 64 bits architectures *)
61-
if !accu > 0x3FFFFFFF then !accu - (1 lsl 31) else !accu
61+
if !accu > 0x3FFFFFFF then !accu - (1 lsl 31) else !accu *)
6262

63-
let todo loc =
63+
(* let todo loc =
6464
failwith (loc ^ " Not supported yet")
65-
65+
*)
6666

6767

6868

jscomp/ext/ext_pervasives.mli

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ val finally :
3939
clean:('a -> 'c) ->
4040
('a -> 'b) -> 'b
4141

42-
val try_it : (unit -> 'a) -> unit
42+
(* val try_it : (unit -> 'a) -> unit *)
4343

4444
val with_file_as_chan : string -> (out_channel -> 'a) -> 'a
4545

@@ -55,14 +55,14 @@ val with_file_as_chan : string -> (out_channel -> 'a) -> 'a
5555

5656

5757

58-
external id : 'a -> 'a = "%identity"
58+
(* external id : 'a -> 'a = "%identity" *)
5959

6060
(** Copied from {!Btype.hash_variant}:
6161
need sync up and add test case
6262
*)
63-
val hash_variant : string -> int
63+
(* val hash_variant : string -> int *)
6464

65-
val todo : string -> 'a
65+
(* val todo : string -> 'a *)
6666

6767
val nat_of_string_exn : string -> int
6868

jscomp/syntax/ast_compatible.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ let object_field l attrs ty =
266266

267267

268268

269-
let hash_label (x : poly_var_label) : int = Ext_pervasives.hash_variant x.txt
269+
let hash_label (x : poly_var_label) : int = Btype.hash_variant x.txt
270270
let label_of_name (x : poly_var_label) : string = x.txt
271271

272272
type args =

lib/4.06.1/bsb.ml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4155,7 +4155,7 @@ val finally :
41554155
clean:('a -> 'c) ->
41564156
('a -> 'b) -> 'b
41574157

4158-
val try_it : (unit -> 'a) -> unit
4158+
(* val try_it : (unit -> 'a) -> unit *)
41594159

41604160
val with_file_as_chan : string -> (out_channel -> 'a) -> 'a
41614161

@@ -4171,14 +4171,14 @@ val with_file_as_chan : string -> (out_channel -> 'a) -> 'a
41714171

41724172

41734173

4174-
external id : 'a -> 'a = "%identity"
4174+
(* external id : 'a -> 'a = "%identity" *)
41754175

41764176
(** Copied from {!Btype.hash_variant}:
41774177
need sync up and add test case
41784178
*)
4179-
val hash_variant : string -> int
4179+
(* val hash_variant : string -> int *)
41804180

4181-
val todo : string -> 'a
4181+
(* val todo : string -> 'a *)
41824182

41834183
val nat_of_string_exn : string -> int
41844184

@@ -4226,8 +4226,8 @@ let finally v ~clean:action f =
42264226
reraise e
42274227
| e -> action v ; e
42284228

4229-
let try_it f =
4230-
try ignore (f ()) with _ -> ()
4229+
(* let try_it f =
4230+
try ignore (f ()) with _ -> () *)
42314231

42324232
let with_file_as_chan filename f =
42334233
finally (open_out_bin filename) ~clean:close_out f
@@ -4237,9 +4237,9 @@ let with_file_as_chan filename f =
42374237

42384238

42394239

4240-
external id : 'a -> 'a = "%identity"
4241-
4240+
(* external id : 'a -> 'a = "%identity" *)
42424241

4242+
(*
42434243
let hash_variant s =
42444244
let accu = ref 0 in
42454245
for i = 0 to String.length s - 1 do
@@ -4248,11 +4248,11 @@ let hash_variant s =
42484248
(* reduce to 31 bits *)
42494249
accu := !accu land (1 lsl 31 - 1);
42504250
(* make it signed for 64 bits architectures *)
4251-
if !accu > 0x3FFFFFFF then !accu - (1 lsl 31) else !accu
4251+
if !accu > 0x3FFFFFFF then !accu - (1 lsl 31) else !accu *)
42524252

4253-
let todo loc =
4253+
(* let todo loc =
42544254
failwith (loc ^ " Not supported yet")
4255-
4255+
*)
42564256

42574257

42584258

@@ -10679,11 +10679,11 @@ let prune_staled_bs_js_files
1067910679
let lazy cmd = bs_cmt_post_process_cmd in
1068010680

1068110681
if cmd <> "" then
10682-
Ext_pervasives.try_it (fun _ ->
10682+
(try ignore (
1068310683
Sys.command (
1068410684
cmd ^
1068510685
" -cmt-rm " ^ filepath)
10686-
)
10686+
: int ) with _ -> ())
1068710687
| Cmj _ ->
1068810688
(* remove .bs.js *)
1068910689
if context.bs_suffix then
@@ -10933,13 +10933,13 @@ let clean_re_js root =
1093310933
| None -> Set_string.empty
1093410934
in
1093510935
Ext_option.iter (Map_string.find_opt map Bsb_build_schemas.sources) begin fun config ->
10936-
Ext_pervasives.try_it (fun () ->
10936+
try (
1093710937
walk_sources { root ;
1093810938
traverse = true;
1093910939
cwd = Filename.current_dir_name;
1094010940
ignored_dirs
1094110941
} config
10942-
)
10942+
) with _ -> ()
1094310943
end
1094410944
| _ -> ()
1094510945
| exception _ -> ()

lib/4.06.1/bsb_helper.ml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,7 +1926,7 @@ val finally :
19261926
clean:('a -> 'c) ->
19271927
('a -> 'b) -> 'b
19281928

1929-
val try_it : (unit -> 'a) -> unit
1929+
(* val try_it : (unit -> 'a) -> unit *)
19301930

19311931
val with_file_as_chan : string -> (out_channel -> 'a) -> 'a
19321932

@@ -1942,14 +1942,14 @@ val with_file_as_chan : string -> (out_channel -> 'a) -> 'a
19421942

19431943

19441944

1945-
external id : 'a -> 'a = "%identity"
1945+
(* external id : 'a -> 'a = "%identity" *)
19461946

19471947
(** Copied from {!Btype.hash_variant}:
19481948
need sync up and add test case
19491949
*)
1950-
val hash_variant : string -> int
1950+
(* val hash_variant : string -> int *)
19511951

1952-
val todo : string -> 'a
1952+
(* val todo : string -> 'a *)
19531953

19541954
val nat_of_string_exn : string -> int
19551955

@@ -1997,8 +1997,8 @@ let finally v ~clean:action f =
19971997
reraise e
19981998
| e -> action v ; e
19991999

2000-
let try_it f =
2001-
try ignore (f ()) with _ -> ()
2000+
(* let try_it f =
2001+
try ignore (f ()) with _ -> () *)
20022002

20032003
let with_file_as_chan filename f =
20042004
finally (open_out_bin filename) ~clean:close_out f
@@ -2008,9 +2008,9 @@ let with_file_as_chan filename f =
20082008

20092009

20102010

2011-
external id : 'a -> 'a = "%identity"
2012-
2011+
(* external id : 'a -> 'a = "%identity" *)
20132012

2013+
(*
20142014
let hash_variant s =
20152015
let accu = ref 0 in
20162016
for i = 0 to String.length s - 1 do
@@ -2019,11 +2019,11 @@ let hash_variant s =
20192019
(* reduce to 31 bits *)
20202020
accu := !accu land (1 lsl 31 - 1);
20212021
(* make it signed for 64 bits architectures *)
2022-
if !accu > 0x3FFFFFFF then !accu - (1 lsl 31) else !accu
2022+
if !accu > 0x3FFFFFFF then !accu - (1 lsl 31) else !accu *)
20232023

2024-
let todo loc =
2024+
(* let todo loc =
20252025
failwith (loc ^ " Not supported yet")
2026-
2026+
*)
20272027

20282028

20292029

0 commit comments

Comments
 (0)