Skip to content

Commit feb795a

Browse files
committed
AST cleanup: remove Pexp_object and Texp_object.
1 parent eee569e commit feb795a

26 files changed

+20
-32
lines changed

analysis/reanalyze/src/Arnold.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -995,9 +995,6 @@ module Compile = struct
995995
| Texp_lazy _ ->
996996
notImplemented "Texp_lazy";
997997
assert false
998-
| Texp_object _ ->
999-
notImplemented "Texp_letmodule";
1000-
assert false
1001998
| Texp_pack _ ->
1002999
notImplemented "Texp_pack";
10031000
assert false

analysis/reanalyze/src/SideEffects.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ let rec exprNoSideEffects (expr : Typedtree.expression) =
6666
| Texp_setinstvar _ -> false
6767
| Texp_override _ -> false
6868
| Texp_letexception (_ec, e) -> e |> exprNoSideEffects
69-
| Texp_object _ -> true
7069
| Texp_pack _ -> false
7170
| Texp_unreachable -> false
7271
| Texp_extension_constructor _ when true -> true

analysis/src/Utils.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ let identifyPexp pexp =
112112
| Pexp_assert _ -> "Pexp_assert"
113113
| Pexp_lazy _ -> "Pexp_lazy"
114114
| Pexp_poly _ -> "Pexp_poly"
115-
| Pexp_object _ -> "Pexp_object"
116115
| Pexp_newtype _ -> "Pexp_newtype"
117116
| Pexp_pack _ -> "Pexp_pack"
118117
| Pexp_extension _ -> "Pexp_extension"

compiler/frontend/bs_ast_invariant.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ let emit_external_warnings : iterator =
9494
(fun self ({pexp_loc = loc} as a) ->
9595
match a.pexp_desc with
9696
| Pexp_constant const -> check_constant loc const
97-
| Pexp_object _ | Pexp_new _ ->
97+
| Pexp_new _ ->
9898
Location.raise_errorf ~loc "OCaml style objects are not supported"
9999
| Pexp_variant (s, None) when Ext_string.is_valid_hash_number s -> (
100100
try ignore (Ext_string.hash_number_as_i32_exn s : int32)

compiler/frontend/bs_ast_mapper.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ module E = struct
370370
| Pexp_lazy e -> lazy_ ~loc ~attrs (sub.expr sub e)
371371
| Pexp_poly (e, t) ->
372372
poly ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t)
373-
| Pexp_object () -> assert false
374373
| Pexp_newtype (s, e) ->
375374
newtype ~loc ~attrs (map_loc sub s) (sub.expr sub e)
376375
| Pexp_pack me -> pack ~loc ~attrs (sub.module_expr sub me)

compiler/ml/ast_iterator.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,6 @@ module E = struct
352352
| Pexp_poly (e, t) ->
353353
sub.expr sub e;
354354
iter_opt (sub.typ sub) t
355-
| Pexp_object () -> ()
356355
| Pexp_newtype (_s, e) -> sub.expr sub e
357356
| Pexp_pack me -> sub.module_expr sub me
358357
| Pexp_open (_ovf, lid, e) ->

compiler/ml/ast_mapper.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ module E = struct
333333
| Pexp_lazy e -> lazy_ ~loc ~attrs (sub.expr sub e)
334334
| Pexp_poly (e, t) ->
335335
poly ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t)
336-
| Pexp_object () -> assert false
337336
| Pexp_newtype (s, e) ->
338337
newtype ~loc ~attrs (map_loc sub s) (sub.expr sub e)
339338
| Pexp_pack me -> pack ~loc ~attrs (sub.module_expr sub me)

compiler/ml/ast_mapper_to0.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ module E = struct
339339
| Pexp_lazy e -> lazy_ ~loc ~attrs (sub.expr sub e)
340340
| Pexp_poly (e, t) ->
341341
poly ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t)
342-
| Pexp_object () -> assert false
343342
| Pexp_newtype (s, e) ->
344343
newtype ~loc ~attrs (map_loc sub s) (sub.expr sub e)
345344
| Pexp_pack me -> pack ~loc ~attrs (sub.module_expr sub me)

compiler/ml/depend.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ let rec add_expr bv exp =
284284
| Pexp_poly (e, t) ->
285285
add_expr bv e;
286286
add_opt add_type bv t
287-
| Pexp_object () -> ()
288287
| Pexp_newtype (_, e) -> add_expr bv e
289288
| Pexp_pack m -> add_module bv m
290289
| Pexp_open (_ovf, m, e) ->

compiler/ml/parsetree.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ and expression_desc =
300300
301301
Can only be used as the expression under Cfk_concrete
302302
for methods (not values). *)
303-
| Pexp_object of unit (* dummy AST node *)
304303
| Pexp_newtype of string loc * expression (* fun (type t) -> E *)
305304
| Pexp_pack of module_expr
306305
(* (module ME)

0 commit comments

Comments
 (0)