forked from ocaml-community/yojson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.mli
49 lines (37 loc) · 953 Bytes
/
common.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
val version : string
exception Json_error of string
val json_error : string -> 'a
type lexer_state = {
buf : Bi_outbuf.t;
(** Buffer used to accumulate substrings *)
mutable lnum : int;
(** Current line number (counting from 1) *)
mutable bol : int;
(** Absolute position of the first character of the current line
(counting from 0) *)
mutable fname : string option;
(** Name referencing the input file in error messages *)
}
module Lexer_state :
sig
type t = lexer_state = {
buf : Bi_outbuf.t;
mutable lnum : int;
mutable bol : int;
mutable fname : string option;
}
end
val init_lexer :
?buf: Bi_outbuf.t ->
?fname: string ->
?lnum: int ->
unit -> lexer_state
(** Create a fresh lexer_state record. *)
(**/**)
(* begin undocumented section *)
exception End_of_array
exception End_of_object
exception End_of_tuple
exception End_of_input
(* end undocumented section *)
(**/**)