File: common.mli

package info (click to toggle)
yojson 2.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,216 kB
  • sloc: ml: 3,890; makefile: 28
file content (43 lines) | stat: -rw-r--r-- 1,106 bytes parent folder | download
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
val version : string

exception Json_error of string
(** Exception used:
    - in JSON readers, if parsing fails;
    - in JSON writers and pretty printing, if [float] value is not allowed in standard JSON. *)

val json_error : string -> 'a
(** @raise Json_error *)

type lexer_state = {
  buf : Buffer.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 : Buffer.t;
    mutable lnum : int;
    mutable bol : int;
    mutable fname : string option;
  }
end

val init_lexer :
  ?buf:Buffer.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 *)
(**/**)