| 1 |
(* Locations in source file,
|
| 2 |
and presentation of results and errors *)
|
| 3 |
|
| 4 |
type source = [ `None | `File of string | `Stream | `String of string ]
|
| 5 |
type loc = source * int * int
|
| 6 |
type precise = [ `Full | `Char of int ]
|
| 7 |
|
| 8 |
exception Location of loc * precise * exn
|
| 9 |
exception Generic of string
|
| 10 |
val noloc:loc
|
| 11 |
val nopos:int * int
|
| 12 |
|
| 13 |
val merge_loc: loc -> loc -> loc
|
| 14 |
|
| 15 |
val raise_loc: int -> int -> exn -> 'a
|
| 16 |
val raise_generic: string -> 'a
|
| 17 |
val raise_loc_generic: loc -> string -> 'a
|
| 18 |
|
| 19 |
val push_source: source -> unit
|
| 20 |
val pop_source: unit -> unit
|
| 21 |
|
| 22 |
val current_dir : unit -> string
|
| 23 |
|
| 24 |
val warning_ppf : Format.formatter ref
|
| 25 |
|
| 26 |
type viewport = [ `Html | `Text ]
|
| 27 |
val set_viewport: viewport -> unit
|
| 28 |
|
| 29 |
val protect: Format.formatter -> (Format.formatter -> unit) -> unit
|
| 30 |
|
| 31 |
val print_loc: Format.formatter -> loc * precise -> unit
|
| 32 |
val dump_loc: Format.formatter -> loc * precise -> unit
|
| 33 |
val html_hilight: Format.formatter -> loc * precise -> unit
|
| 34 |
|
| 35 |
type 'a located = { loc : loc; descr : 'a }
|
| 36 |
val mk: int * int -> 'a -> 'a located
|
| 37 |
val mk_loc: loc -> 'a -> 'a located
|
| 38 |
val mknoloc: 'a -> 'a located
|
| 39 |
|
| 40 |
val loc_of_pos : int * int -> loc
|
| 41 |
|
| 42 |
|
| 43 |
(* Are we working in a protected environement (web prototype ...) ? *)
|
| 44 |
val set_protected : bool -> unit
|
| 45 |
val is_protected : unit -> bool
|
| 46 |
val protect_op : string -> unit
|