package ortac-wrapper

  1. Overview
  2. Docs
Wrapper plugin for Ortac

Install

Dune Dependency

Authors

Maintainers

Sources

0.7.0.tar.gz
md5=1429cb7ec517060772f97504d84ff789
sha512=498e1b40dd29f5feef3df5fa54f924c7b53f24726b1613a5d8dd7ef8ca16b8cf97a76b9fd2951f32143b59a67b8d80fe13b081890fca07787a5a5fda30102a97

doc/src/ortac-wrapper.plugin/ortac_wrapper.ml.html

Source file ortac_wrapper.ml

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
open Cmdliner
open Registration

(* reexpose Generate module as it is used by the monolith plugin for example *)
module Generate = Generate

module Plugin : sig
  val cmd : unit Cmd.t
end = struct
  let main input output () =
    let fmt = get_out_formatter output in
    try Generate.generate input fmt
    with Gospel.Warnings.Error e ->
      Fmt.epr "%a@." Gospel.Warnings.pp e;
      exit 1

  let info =
    Cmd.info "wrapper"
      ~doc:
        "Wrap module functions with assertions to check their specifications."

  let term = Term.(const main $ ocaml_file $ output_file $ setup_log)
  let cmd = Cmd.v info term
end

let () = register Plugin.cmd
OCaml

Innovation. Community. Security.