Module Asai.ExplicationSource

The definition of highlighted text suitable for rendering. You probably do not need this module unless you want to create your own diagnostic handler.

Types

Sourcetype 'tag segment = 'tag option * string

A segment is an optionally tagged string from the user content. (Note the use of option.)

Sourcetype 'tag line = {
  1. tags : 'tag list;
  2. segments : 'tag segment list;
}

A line is a list of segments along with tags.

Sourcetype 'tag block = {
  1. begin_line_num : int;
    (*

    The starting 1-indexed line number of a block.

    *)
  2. end_line_num : int;
    (*

    The ending 1-indexed line number of a block.

    *)
  3. lines : 'tag line list;
    (*

    The lines within a block.

    *)
}

A block is a collection of consecutive lines.

Sourcetype 'tag part = {
  1. source : Range.source;
    (*

    The source of a part.

    *)
  2. blocks : 'tag block list;
    (*

    The blocks within a part.

    *)
}

A part consists of multiple blocks from the same file. These blocks should be non-overlapping and sorted by importance or the textual order.

Sourcetype 'tag t = 'tag part list

Highlighted texts.

Debugging

Sourceval dump : (Format.formatter -> 'tag -> unit) -> Format.formatter -> 'tag t -> unit

Ugly printer for debugging