location.mli 634 Bytes
Newer Older
1
2
(* Locations in source file,
   and presentation of results and errors *)
3

4
type loc = int * int
5
exception Location of loc * exn
6
7
8
9
exception Generic of string
val noloc:loc

type source = [ `None | `File of string | `Stream | `String of string ]
10
val set_source: source -> unit
11

12
13
14
type viewport = [ `Html | `Text ]
val set_viewport: viewport -> unit

15
val protect: Format.formatter -> (Format.formatter -> unit) -> unit
16

17
val print_loc: Format.formatter -> loc -> unit
18
19
val dump_loc: Format.formatter -> loc -> unit
val html_hilight: Format.formatter -> loc -> unit
20
21
22

type 'a located = { loc : loc; descr : 'a }
val mk: loc -> 'a -> 'a located