Skip to content

Commit 0a0a0f5

Browse files
hhugoclaude
andcommitted
Clean up Std_ast: remove Repl_file, Documentation, of_syntax, any_t
Std_ast becomes a purely internal implementation detail. Remove constructors and functions that are no longer needed now that Translation_unit no longer references Std_ast directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8868a7d commit 0a0a0f5

2 files changed

Lines changed: 0 additions & 29 deletions

File tree

lib/Std_ast.ml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,6 @@ type 'a t =
2222
| Module_type : module_type t
2323
| Expression : expression t
2424
| Pattern : pattern t
25-
(* not implemented *)
26-
| Repl_file : unit t
27-
| Documentation : unit t
28-
29-
type any_t = Any : 'a t -> any_t [@@unboxed]
30-
31-
let of_syntax = function
32-
| Syntax.Structure -> Any Structure
33-
| Signature -> Any Signature
34-
| Use_file -> Any Use_file
35-
| Core_type -> Any Core_type
36-
| Module_type -> Any Module_type
37-
| Expression -> Any Expression
38-
| Pattern -> Any Pattern
39-
| Repl_file -> Any Repl_file
40-
| Documentation -> Any Documentation
4125

4226
let equal (type a) (_ : a t) : a -> a -> bool = Poly.equal
4327

@@ -55,8 +39,6 @@ let map (type a) (x : a t) (m : Ast_mapper.mapper) : a -> a =
5539
| Module_type -> m.module_type m
5640
| Expression -> m.expr m
5741
| Pattern -> m.pat m
58-
| Repl_file -> Fn.id
59-
| Documentation -> Fn.id
6042

6143
module Parse = struct
6244
let ast (type a) (fg : a t) ~ocaml_version ~input_name str : a =
@@ -73,8 +55,6 @@ module Parse = struct
7355
| Module_type -> Parse.module_type ~ocaml_version lexbuf
7456
| Expression -> Parse.expression ~ocaml_version lexbuf
7557
| Pattern -> Parse.pattern ~ocaml_version lexbuf
76-
| Repl_file -> ()
77-
| Documentation -> ()
7858
end
7959

8060
module Printast = struct
@@ -90,6 +70,4 @@ module Printast = struct
9070
| Module_type -> module_type 0
9171
| Expression -> expression 0
9272
| Pattern -> pattern 0
93-
| Repl_file -> fun _ _ -> ()
94-
| Documentation -> fun _ _ -> ()
9573
end

lib/Std_ast.mli

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ type 'a t =
2525
| Module_type : module_type t
2626
| Expression : expression t
2727
| Pattern : pattern t
28-
(* not implemented *)
29-
| Repl_file : unit t
30-
| Documentation : unit t
31-
32-
type any_t = Any : 'a t -> any_t [@@unboxed]
33-
34-
val of_syntax : Syntax.t -> any_t
3528

3629
module Parse : sig
3730
val ast :

0 commit comments

Comments
 (0)