package ostap

  1. Overview
  2. Docs

Predefined implementation of reason type to describe various errors happened during parsing.

type p

Interior type.

type retrieved = (Msg.Locator.t * [ `Msg of Msg.t | `Comment of string * 'a ] list) list as 'a

Exterior representation

class t : Msg.t -> object ... end

Main class. Keeps track on error reasons and comments. Takes an ordinary message on creation.

val reason : Msg.t -> t option

Synonym for reason construction.

val toString : [ `All | `First of int ] -> [ `Acc | `Desc ] -> t option -> string

Standard printer for optional reason. The first two arguments have the following meanings:

  • `All makes printer show all the messages while `First n asks only for n first of them; this is desirable since there can potentially be many parasite messages;
  • `Acc asks printer to output messages in ascending order w.r.t. locator information while `Desc asks to print them in descending order.
OCaml

Innovation. Community. Security.