Opinionated OCaml linter with Merlin integration for code quality, naming conventions, and style checks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

xmlt/csvt/sexpt: rebind exception as Xmlt.Error/Csvt.Error/Sexp(t).Error

OCaml's exception rebinding (exception Error = Textloc.Error in the .ml,
matching a fresh exception Error of Error.t declaration in the .mli)
lets consumers write:

try ... with Xmlt.Error e -> ...
try ... with Csvt.Error e -> ...
try ... with Sexp.Error e -> ...
try ... with Sexpt.Error e -> ...

rather than the verbose Xmlt.Textloc.Error. At link time these are
all the same exception constructor as Textloc.Error, so cross-package
error propagation still works.

Downstream fixes:
- merlint/lib/dune: drop textloc (reachable via Sexp).
- merlint/lib/dune.ml: catch Sexp.Error instead of Textloc.Error.
- ocaml-s3/lib/s3.ml: Xmlt.Meta.none instead of Textloc.Meta.none.
- ocaml-sexpt/test/dune: drop textloc (reachable via Sexp / Sexpt).
- ocaml-sexpt/test/test_sexp.ml and test_sexpt.ml: use Sexp.Textloc /
Sexpt.Textloc (and their submodules) rather than bare Textloc.

No code outside ocaml-textloc, ocaml-xmlt, ocaml-csvt, ocaml-sexpt,
ocaml-yamlt now depends on textloc directly. All 334 tests pass.

+2 -3
+1 -2
lib/dune
··· 16 16 tty 17 17 jsont 18 18 jsont.bytesrw 19 - sexpt 20 - textloc)) 19 + sexpt)) 21 20 22 21 (rule 23 22 (target examples.ml)
+1 -1
lib/dune.ml
··· 100 100 m "Parsed dune file %a: found %d stanzas" Fpath.pp filename 101 101 (List.length stanzas)); 102 102 stanzas 103 - with Sys_error _ | End_of_file | Textloc.Error _ -> [] 103 + with Sys_error _ | End_of_file | Sexp.Error _ -> [] 104 104 105 105 (** Extract modules from a modules field *) 106 106 let extract_modules_field = function