package mdx

  1. Overview
  2. Docs

Module Mdx.ToplevelSource

Toplevel phrases.

Sourcetype t = {
  1. vpad : int;
  2. hpad : int;
  3. pos : Lexing.position;
  4. command : string list;
  5. output : Output.t list;
}

The type for top-level phrases.

Sourcetype toplevel_tests = {
  1. tests : t list;
  2. end_pad : string option;
}

Pretty-printing

Sourceval dump : t Fmt.t

dump is the printer for dumping toplevel phrases. Useful for debugging.

Sourceval dump_toplevel_tests : toplevel_tests Fmt.t
Sourceval pp : t Fmt.t

pp is the pretty-printer for top-level phrases. pad is the size of the optionnalwhitespace left padding (by default is is 0).

Sourceval pp_command : t Fmt.t

pp_command is the pretty-printer for toplevel commands.

Parser

Sourceval of_lines : loc:Location.t -> string list -> toplevel_tests

of_lines ~loc lines is the list of toplevel blocks from location loc. Return the vertical and horizontal whitespace padding as well.

OCaml

Innovation. Community. Security.