forked from ocaml-ppx/ocamlformat
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathNormalize.mli
36 lines (28 loc) · 1.48 KB
/
Normalize.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
(**************************************************************************)
(* *)
(* OCamlFormat *)
(* *)
(* Copyright (c) Facebook, Inc. and its affiliates. *)
(* *)
(* This source code is licensed under the MIT license found in *)
(* the LICENSE file in the root directory of this source tree. *)
(* *)
(**************************************************************************)
(** Normalize abstract syntax trees *)
val dedup_cmts : 'a Extended_ast.t -> 'a -> Cmt.t list -> Cmt.t list
val comment : string -> string
(** Normalize a comment. *)
val docstring : Conf.t -> string -> string
(** Normalize a docstring. *)
val normalize : 'a Std_ast.t -> Conf.t -> 'a -> 'a
(** Normalize an AST fragment. *)
val equal :
'a Std_ast.t -> ignore_doc_comments:bool -> Conf.t -> 'a -> 'a -> bool
(** Compare fragments for equality up to normalization. *)
type docstring_error =
| Moved of Location.t * Location.t * string
| Unstable of Location.t * string * string
| Added of Location.t * string
| Removed of Location.t * string
val moved_docstrings :
'a Std_ast.t -> Conf.t -> 'a -> 'a -> docstring_error list