package minicaml

  1. Overview
  2. Docs

Module Minicaml.ErrorsSource

Sourcetype location =
  1. | Location of Lexing.position * Lexing.position
    (*

    delimited location

    *)
  2. | Nowhere
    (*

    no location

    *)
Sourceval location_of_lex : Lexing.lexbuf -> location
Sourceexception Error of location * string * string

Exception Error (loc, err, msg) indicates an error of type err with error message msg, occurring at location loc.

error ~loc ~kind raises an error of the given kind. The kfprintf magic allows one to write msg using a format string.

Sourceval error : ?kind:string -> ?loc:location -> ('a, Format.formatter, unit, 'b) format4 -> 'a
Sourceval print_location : location -> Format.formatter -> unit
Sourceval print_message : ?color:T.color -> ?loc:location -> string -> ('a, Format.formatter, unit, unit) format4 -> 'a

Print a message at a given location loc of message type msg_type.

Sourceval print_error : (location * string * string) -> unit

Print the caught error

Sourceval fatal_error : ('a, Format.formatter, unit, 'b) format4 -> 'a

A fatal error reported by the toplevel.

Sourceval syntax_error : ?loc:location -> ('a, Format.formatter, unit, 'b) format4 -> 'a

A syntax error reported by the toplevel

OCaml

Innovation. Community. Security.