[OCaml] Org mode parser.
refactor restrict public API to types and to_string
Org.Diagnostic now only exposes severity, t, and to_string. Internal functions (create_collector, add, warn, to_list) are hidden from consumers while remaining available within the library.
lib/org.ml
@@ -15,8 +15,23 @@
15
15
module Ast = Ast
16
16
module Config = Config
17
17
module Prescan = Prescan
18
Removed:
module Diagnostic = Diagnostic
18
Added:
module Diagnostic : sig
19
Added:
(** Severity levels for diagnostics. *)
20
Added:
type severity = Diagnostic.severity =
21
Added:
| Warning (** Recoverable issue, structure was inferred *)
22
Added:
| Error (** Significant structural issue *)
19
23
24
Added:
(** A single diagnostic. *)
25
Added:
type t = Diagnostic.t = {
26
Added:
severity : severity;
27
Added:
line : int; (** 1-based line number, 0 if unknown *)
28
Added:
message : string;
29
Added:
}
30
Added:
31
Added:
(** Format a diagnostic as a human-readable string. *)
32
Added:
val to_string : t -> string
33
Added:
end = Diagnostic
34
Added:
20
35
(** {1 Internal sub-modules}
21
36
22
37
These are exposed for testing and advanced use. They are not