Skip to content

Commit 74e9317

Browse files
committed
comment unused code
1 parent ab9ed6c commit 74e9317

24 files changed

+462
-546
lines changed

jscomp/core/lam.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ val switch : t -> lambda_switch -> t
117117
(** constant folding*)
118118
val stringswitch : t -> (string * t) list -> t option -> t
119119

120-
val true_ : t
121-
val false_ : t
120+
(* val true_ : t *)
121+
(* val false_ : t *)
122122
val unit : t
123123

124124
(** convert [l || r] to [if l then true else r]*)

jscomp/syntax/ast_attributes.ml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ let process_derive_type (attrs : t) : derive_attr * t =
179179
st, attr::acc
180180
)
181181

182-
let iter_process_derive_type (attrs : t) =
182+
(* let iter_process_derive_type (attrs : t) =
183183
let st = ref {explict_nonrec = false; bs_deriving = None } in
184184
Ext_list.iter attrs
185185
(fun ({txt ; loc}, payload as attr) ->
@@ -203,7 +203,7 @@ let iter_process_derive_type (attrs : t) =
203203
(* non bs attribute, no need to mark its use *)
204204
| _ -> ()
205205
) ;
206-
!st
206+
!st *)
207207

208208

209209
(* duplicated [bs.uncurry] [bs.string] not allowed,
@@ -345,23 +345,17 @@ let iter_process_bs_string_or_int_as (attrs : Parsetree.attributes) =
345345
!st
346346

347347
let locg = Location.none
348-
let bs : attr
349-
= {txt = "bs" ; loc = locg}, Ast_payload.empty
348+
(* let bs : attr
349+
= {txt = "bs" ; loc = locg}, Ast_payload.empty *)
350350

351351
let is_bs (attr : attr) =
352352
match attr with
353353
| {Location.txt = "bs"; _}, _ -> true
354354
| _ -> false
355355

356-
let is_optional (attr : attr) =
357-
match attr with
358-
| {Location.txt = "bs.optional"; _}, _ -> true
359-
| _ -> false
360356

361-
let is_bs_as (attr : attr) =
362-
match attr with
363-
| {Location.txt = "bs.as"; _}, _ -> true
364-
| _ -> false
357+
358+
365359

366360
let bs_get : attr
367361
= {txt = "bs.get"; loc = locg}, Ast_payload.empty
@@ -396,12 +390,3 @@ let bs_return_undefined : attr
396390
},[])
397391
; pstr_loc = locg}]
398392

399-
let deprecated s : attr =
400-
{txt = "ocaml.deprecated"; loc = locg },
401-
PStr
402-
[
403-
{pstr_desc =
404-
Pstr_eval (
405-
Ast_compatible.const_exp_string ~loc:locg s,
406-
[])
407-
; pstr_loc = locg}]

jscomp/syntax/ast_attributes.mli

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ val iter_process_bs_string_or_int_as :
9393
val process_derive_type :
9494
t -> derive_attr * t
9595

96-
val iter_process_derive_type :
96+
(* val iter_process_derive_type :
9797
t -> derive_attr
9898
9999
100-
val bs : attr
100+
val bs : attr *)
101101
val is_bs : attr -> bool
102-
val is_optional : attr -> bool
103-
val is_bs_as : attr -> bool
102+
(* val is_optional : attr -> bool
103+
val is_bs_as : attr -> bool *)
104104

105105

106106

@@ -109,4 +109,4 @@ val bs_get_arity : attr
109109
val bs_set : attr
110110
val bs_return_undefined : attr
111111

112-
val deprecated : string -> attr
112+
(* val deprecated : string -> attr *)

jscomp/syntax/ast_comb.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ open Ast_helper
3131
Ast_compatible.fun_ ?loc ?attrs pat body *)
3232

3333

34-
let discard_exp_as_unit loc e =
34+
(* let discard_exp_as_unit loc e =
3535
Ast_compatible.apply_simple ~loc
3636
(Exp.ident ~loc {txt = Ast_literal.Lid.ignore_id; loc})
3737
[Exp.constraint_ ~loc e
38-
(Ast_literal.type_unit ~loc ())]
38+
(Ast_literal.type_unit ~loc ())] *)
3939

4040

4141
let tuple_type_pair ?loc kind arity =

jscomp/syntax/ast_comb.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
we can use [unit] value (though very little chance)
3232
sometimes
3333
*)
34-
val discard_exp_as_unit :
35-
Location.t -> Parsetree.expression -> Parsetree.expression
34+
(* val discard_exp_as_unit :
35+
Location.t -> Parsetree.expression -> Parsetree.expression *)
3636

3737

3838
val tuple_type_pair :

jscomp/syntax/ast_compatible.ml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ let fun_
105105
pexp_desc = Pexp_fun(Nolabel,None, pat, exp)
106106
}
107107

108-
let opt_label s =
109-
Asttypes.Optional s
108+
(* let opt_label s =
109+
Asttypes.Optional s *)
110110

111-
let label_fun
111+
(* let label_fun
112112
?(loc = default_loc)
113113
?(attrs = [])
114114
~label
@@ -118,7 +118,7 @@ let label_fun
118118
pexp_loc = loc;
119119
pexp_attributes = attrs;
120120
pexp_desc = Pexp_fun(label, None, pat, exp)
121-
}
121+
} *)
122122

123123

124124

@@ -204,13 +204,13 @@ let rec_type_str ?(loc=default_loc) tds : structure_item =
204204
tds)
205205
}
206206

207-
let nonrec_type_str ?(loc=default_loc) tds : structure_item =
207+
(* let nonrec_type_str ?(loc=default_loc) tds : structure_item =
208208
{
209209
pstr_loc = loc;
210210
pstr_desc = Pstr_type (
211211
Nonrecursive,
212212
tds)
213-
}
213+
} *)
214214

215215
let rec_type_sig ?(loc=default_loc) tds : signature_item =
216216
{
@@ -221,22 +221,22 @@ let rec_type_sig ?(loc=default_loc) tds : signature_item =
221221
}
222222

223223
(* FIXME: need address migration of `[@nonrec]` attributes in older ocaml *)
224-
let nonrec_type_sig ?(loc=default_loc) tds : signature_item =
224+
(* let nonrec_type_sig ?(loc=default_loc) tds : signature_item =
225225
{
226226
psig_loc = loc;
227227
psig_desc = Psig_type (
228228
Nonrecursive,
229229
tds)
230-
}
230+
} *)
231231

232232

233233
let const_exp_int_list_as_array xs =
234234
Ast_helper.Exp.array
235235
(Ext_list.map xs (fun x -> const_exp_int x ))
236236

237-
let const_exp_string_list_as_array xs =
237+
(* let const_exp_string_list_as_array xs =
238238
Ast_helper.Exp.array
239-
(Ext_list.map xs (fun x -> const_exp_string x ) )
239+
(Ext_list.map xs (fun x -> const_exp_string x ) ) *)
240240

241241
type param_type =
242242
{label : Asttypes.arg_label ;

jscomp/syntax/ast_compatible.mli

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ val const_exp_int_list_as_array:
5353
int list ->
5454
expression
5555

56-
val const_exp_string_list_as_array:
56+
(* val const_exp_string_list_as_array:
5757
string list ->
58-
expression
58+
expression *)
5959

6060

6161
val apply_simple:
@@ -109,15 +109,15 @@ val fun_ :
109109
expression ->
110110
expression
111111

112-
val opt_label : string -> Asttypes.arg_label
112+
(* val opt_label : string -> Asttypes.arg_label *)
113113

114-
val label_fun :
114+
(* val label_fun :
115115
?loc:Location.t ->
116116
?attrs:attrs ->
117117
label:Asttypes.arg_label ->
118118
pattern ->
119119
expression ->
120-
expression
120+
expression *)
121121

122122
val arrow :
123123
?loc:Location.t ->
@@ -150,20 +150,20 @@ val object_:
150150
core_type
151151

152152

153-
val nonrec_type_str:
153+
(* val nonrec_type_str:
154154
?loc:loc ->
155155
type_declaration list ->
156-
structure_item
156+
structure_item *)
157157

158158
val rec_type_str:
159159
?loc:loc ->
160160
type_declaration list ->
161161
structure_item
162162

163-
val nonrec_type_sig:
163+
(* val nonrec_type_sig:
164164
?loc:loc ->
165165
type_declaration list ->
166-
signature_item
166+
signature_item *)
167167

168168
val rec_type_sig:
169169
?loc:loc ->

jscomp/syntax/ast_core_type.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ let is_any (ty : t) =
4747

4848
open Ast_helper
4949

50-
let replace_result (ty : t) (result : t) : t =
50+
(* let replace_result (ty : t) (result : t) : t =
5151
let rec aux (ty : Parsetree.core_type) =
5252
match ty with
5353
| { ptyp_desc =
@@ -56,17 +56,17 @@ let replace_result (ty : t) (result : t) : t =
5656
| {ptyp_desc = Ptyp_poly(fs,ty)}
5757
-> {ty with ptyp_desc = Ptyp_poly(fs, aux ty)}
5858
| _ -> result in
59-
aux ty
59+
aux ty *)
6060

6161
let is_unit (ty : t ) =
6262
match ty.ptyp_desc with
6363
| Ptyp_constr({txt =Lident "unit"}, []) -> true
6464
| _ -> false
6565

66-
let is_array (ty : t) =
66+
(* let is_array (ty : t) =
6767
match ty.ptyp_desc with
6868
| Ptyp_constr({txt =Lident "array"}, [_]) -> true
69-
| _ -> false
69+
| _ -> false *)
7070

7171
let is_user_option (ty : t) =
7272
match ty.ptyp_desc with
@@ -76,15 +76,15 @@ let is_user_option (ty : t) =
7676
[_]) -> true
7777
| _ -> false
7878

79-
let is_user_bool (ty : t) =
79+
(* let is_user_bool (ty : t) =
8080
match ty.ptyp_desc with
8181
| Ptyp_constr({txt = Lident "bool"},[]) -> true
82-
| _ -> false
82+
| _ -> false *)
8383

84-
let is_user_int (ty : t) =
84+
(* let is_user_int (ty : t) =
8585
match ty.ptyp_desc with
8686
| Ptyp_constr({txt = Lident "int"},[]) -> true
87-
| _ -> false
87+
| _ -> false *)
8888

8989

9090

jscomp/syntax/ast_core_type.mli

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ type t = Parsetree.core_type
2929

3030
val lift_option_type : t -> t
3131
val is_any : t -> bool
32-
val replace_result : t -> t -> t
32+
(* val replace_result : t -> t -> t *)
3333

3434
(* val opt_arrow: Location.t -> string -> t -> t -> t *)
3535

3636
val is_unit : t -> bool
37-
val is_array : t -> bool
37+
(* val is_array : t -> bool *)
3838

3939

4040
(** return a function type
@@ -52,9 +52,9 @@ val make_obj :
5252

5353
val is_user_option : t -> bool
5454

55-
val is_user_bool : t -> bool
55+
(* val is_user_bool : t -> bool
5656
57-
val is_user_int : t -> bool
57+
val is_user_int : t -> bool *)
5858

5959

6060

jscomp/syntax/ast_derive_util.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ let new_type_of_type_declaration
5252
)
5353

5454

55-
let mk_fun ~loc (typ : Parsetree.core_type)
55+
(* let mk_fun ~loc (typ : Parsetree.core_type)
5656
(value : string) body
5757
: Parsetree.expression =
5858
Ast_compatible.fun_
@@ -71,7 +71,7 @@ let destruct_label_declarations ~loc
7171
Exp.field (Exp.ident {txt = Lident arg_name ; loc})
7272
{txt = Lident txt ; loc}) :: core_type_exps),
7373
txt :: labels
74-
)
74+
) *)
7575

7676
let notApplicable
7777
loc derivingName =

jscomp/syntax/ast_derive_util.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ val new_type_of_type_declaration :
3434
Parsetree.core_type * Parsetree.type_declaration
3535

3636

37-
val mk_fun :
37+
(* val mk_fun :
3838
loc:Location.t ->
3939
Parsetree.core_type ->
4040
string -> Parsetree.expression -> Parsetree.expression
4141
val destruct_label_declarations :
4242
loc:Location.t ->
4343
string ->
4444
Parsetree.label_declaration list ->
45-
(Parsetree.core_type * Parsetree.expression) list * string list
45+
(Parsetree.core_type * Parsetree.expression) list * string list *)
4646

4747
val notApplicable:
4848
Location.t ->

jscomp/syntax/ast_payload.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ let as_ident (x : t ) =
143143
}
144144
] -> Some ident
145145
| _ -> None
146-
open Ast_helper
146+
(* open Ast_helper *)
147147

148-
let raw_string_payload loc (s : string) : t =
149-
PStr [ Str.eval ~loc (Ast_compatible.const_exp_string ~loc s) ]
148+
(* let raw_string_payload loc (s : string) : t =
149+
PStr [ Str.eval ~loc (Ast_compatible.const_exp_string ~loc s) ] *)
150150

151151

152152
type lid = string Asttypes.loc

jscomp/syntax/ast_payload.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ val raw_as_string_exp_exn :
5151
val as_core_type : Location.t -> t -> Parsetree.core_type
5252
(* val as_empty_structure : t -> bool *)
5353
val as_ident : t -> Longident.t Asttypes.loc option
54-
val raw_string_payload : Location.t -> string -> t
54+
(* val raw_string_payload : Location.t -> string -> t *)
5555
val assert_strings :
5656
Location.t -> t -> string list
5757

jscomp/syntax/ast_polyvar.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ val map_row_fields_into_strings:
3838
External_arg_spec.attr
3939

4040

41-
val is_enum :
41+
(* val is_enum :
4242
Parsetree.row_field list ->
43-
bool
43+
bool *)
4444

4545
val is_enum_polyvar :
4646
Parsetree.type_declaration ->

0 commit comments

Comments
 (0)