@@ -25,6 +25,7 @@ type 'a t =
2525 | Core_type : core_type t
2626 | Module_type : module_type t
2727 | Expression : expression t
28+ | Pattern : pattern t
2829 | Repl_file : repl_file t
2930 | Documentation : Ocamlformat_odoc_parser.Ast .t t
3031
@@ -37,6 +38,7 @@ let of_syntax = function
3738 | Core_type -> Any Core_type
3839 | Module_type -> Any Module_type
3940 | Expression -> Any Expression
41+ | Pattern -> Any Pattern
4042 | Repl_file -> Any Repl_file
4143 | Documentation -> Any Documentation
4244
@@ -50,6 +52,7 @@ let map (type a) (x : a t) (m : Ast_mapper.mapper) : a -> a =
5052 | Core_type -> m.typ m
5153 | Module_type -> m.module_type m
5254 | Expression -> m.expr m
55+ | Pattern -> m.pat m
5356 | Repl_file -> List. map ~f: (m.repl_phrase m)
5457 | Documentation -> Fn. id
5558
@@ -253,6 +256,7 @@ module Parse = struct
253256 | Core_type -> Parse. core_type ~ocaml_version lexbuf
254257 | Module_type -> Parse. module_type ~ocaml_version lexbuf
255258 | Expression -> Parse. expression ~ocaml_version lexbuf
259+ | Pattern -> Parse. pattern ~ocaml_version lexbuf
256260 | Repl_file -> Toplevel_lexer. repl_file ~ocaml_version lexbuf
257261 | Documentation ->
258262 let pos = (Location. curr lexbuf).loc_start in
@@ -274,6 +278,7 @@ module Printast = struct
274278 | Core_type -> core_type
275279 | Module_type -> module_type
276280 | Expression -> expression
281+ | Pattern -> pattern
277282 | Repl_file -> repl_file
278283 | Documentation -> Docstring. dump
279284end
0 commit comments