package ostap

  1. Overview
  2. Docs

Parsing message interface.

Messaging operations

module Coord : sig ... end

Text coordinate.

module MC : Map.S with type key = Coord.t
module Locator : sig ... end

Various ways to denote the location in the source text.

module FileLoc : sig ... end
type t

Type of the message.

val make : string -> string array -> Locator.t -> t

General constructor. make phrase args loc creates message with format string phrase, arguments args and locator loc. Format string may contain parameter references of the form "%0", "%1", "%2" etc. These references to be substituted with corresponding actual values (i.e. args.(0), args.(1) etc.) during toString visualization. For example, toString {phrase="%0 %1 not found"; args=[|"type"; "int"|]; loc=No} is "type int not found".

val phrase : string -> t

Custom constructor; takes no parameters, no locator.

val orphan : string -> string array -> t

Custom constructor; takes no locator.

val loc : t -> Locator.t

Gets locator of a message.

val string : t -> string

Substitute parameters.

val toString : t -> string

Visualization with parameter substitution.

val augment : t -> Locator.t -> t

Augment the message with the location (replaces Locator.No (if any) in its argument with the loc).

val augmentList : t list -> Locator.t -> t list

Augment the list of messages with the location.

val extend : t -> string -> t

Extends phrase of the message by given string.

val extendList : t list -> string -> t list

Extends all phrases of the list of messages by given string.

OCaml

Innovation. Community. Security.