Skip to content

Commit f9aa2b3

Browse files
committed
Remove class_field.
1 parent 755b2be commit f9aa2b3

File tree

6 files changed

+4
-69
lines changed

6 files changed

+4
-69
lines changed

jscomp/frontend/bs_ast_mapper.ml

-1
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,6 @@ module P = struct
458458
| Ppat_extension x -> extension ~loc ~attrs (sub.extension sub x)
459459
end
460460

461-
462461
(* Now, a generic AST mapper, to be extended to cover all kinds and
463462
cases of the OCaml grammar. The default behavior of the mapper is
464463
the identity. *)

jscomp/ml/ast_helper.ml

-28
Original file line numberDiff line numberDiff line change
@@ -313,34 +313,6 @@ module Ctf = struct
313313

314314
end
315315

316-
module Cf = struct
317-
let mk ?(loc = !default_loc) ?(attrs = [])
318-
?(docs = empty_docs) d =
319-
{
320-
pcf_desc = d;
321-
pcf_loc = loc;
322-
pcf_attributes = add_docs_attrs docs attrs;
323-
}
324-
325-
326-
let val_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_val (a, b, c))
327-
let method_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_method (a, b, c))
328-
let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcf_constraint (a, b))
329-
let initializer_ ?loc ?attrs a = mk ?loc ?attrs (Pcf_initializer a)
330-
let extension ?loc ?attrs a = mk ?loc ?attrs (Pcf_extension a)
331-
let attribute ?loc a = mk ?loc (Pcf_attribute a)
332-
let text txt =
333-
let f_txt = Ext_list.filter txt (fun ds -> docstring_body ds <> "")in
334-
List.map
335-
(fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
336-
f_txt
337-
338-
let virtual_ ct = Cfk_virtual ct
339-
let concrete o e = Cfk_concrete (o, e)
340-
341-
let attr d a = {d with pcf_attributes = d.pcf_attributes @ [a]}
342-
343-
end
344316

345317
module Val = struct
346318
let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)

jscomp/ml/ast_helper.mli

-23
Original file line numberDiff line numberDiff line change
@@ -370,29 +370,6 @@ module Ctf:
370370
val text: text -> class_type_field list
371371
end
372372

373-
(** Class fields *)
374-
module Cf:
375-
sig
376-
val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> class_field_desc ->
377-
class_field
378-
val attr: class_field -> attribute -> class_field
379-
380-
val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag ->
381-
class_field_kind -> class_field
382-
val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag ->
383-
class_field_kind -> class_field
384-
val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
385-
class_field
386-
val initializer_: ?loc:loc -> ?attrs:attrs -> expression -> class_field
387-
val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_field
388-
val attribute: ?loc:loc -> attribute -> class_field
389-
val text: text -> class_field list
390-
391-
val virtual_: core_type -> class_field_kind
392-
val concrete: override_flag -> expression -> class_field_kind
393-
394-
end
395-
396373
(** Classes *)
397374
module Ci:
398375
sig

jscomp/ml/parser.ml

+2-3
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ let mkstr d = Str.mk ~loc:(symbol_rloc()) d
139139
let mkcty ?attrs d = Cty.mk ~loc:(symbol_rloc()) ?attrs d
140140
let mkctf ?attrs ?docs d =
141141
Ctf.mk ~loc:(symbol_rloc()) ?attrs ?docs d
142-
let mkcf ?attrs ?docs d =
143-
Cf.mk ~loc:(symbol_rloc()) ?attrs ?docs d
142+
let mkcf ?attrs ?docs _d = let _ = (attrs, docs) in assert false
144143

145144
let mkrhs rhs pos = mkloc rhs (rhs_loc pos)
146145

@@ -346,7 +345,7 @@ let mksig_ext d ext =
346345

347346
let text_str pos = Str.text (rhs_text pos)
348347
let text_sig pos = Sig.text (rhs_text pos)
349-
let text_cstr pos = Cf.text (rhs_text pos)
348+
let text_cstr _pos = assert false
350349
let text_csig pos = Ctf.text (rhs_text pos)
351350

352351

jscomp/ml/parser.mly

+2-3
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ let mkstr d = Str.mk ~loc:(symbol_rloc()) d
3333
let mkcty ?attrs d = Cty.mk ~loc:(symbol_rloc()) ?attrs d
3434
let mkctf ?attrs ?docs d =
3535
Ctf.mk ~loc:(symbol_rloc()) ?attrs ?docs d
36-
let mkcf ?attrs ?docs d =
37-
Cf.mk ~loc:(symbol_rloc()) ?attrs ?docs d
36+
let mkcf ?attrs ?docs d = assert false
3837

3938
let mkrhs rhs pos = mkloc rhs (rhs_loc pos)
4039

@@ -240,7 +239,7 @@ let mksig_ext d ext =
240239

241240
let text_str pos = Str.text (rhs_text pos)
242241
let text_sig pos = Sig.text (rhs_text pos)
243-
let text_cstr pos = Cf.text (rhs_text pos)
242+
let text_cstr pos = assert false
244243
let text_csig pos = Ctf.text (rhs_text pos)
245244

246245

jscomp/ml/parsetree.ml

-11
Original file line numberDiff line numberDiff line change
@@ -564,17 +564,6 @@ and class_type_declaration = class_type class_infos
564564
(* Value expressions for the class language *)
565565

566566

567-
(* object(selfpat) ... end
568-
object ... end (self = Ppat_any)
569-
*)
570-
571-
and class_field =
572-
{
573-
pcf_desc: class_field_desc;
574-
pcf_loc: Location.t;
575-
pcf_attributes: attributes; (* ... [@@id1] [@@id2] *)
576-
}
577-
578567
and class_field_desc =
579568
| Pcf_inherit of unit
580569
(* inherit CE

0 commit comments

Comments
 (0)