1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
type t = Lexing.lexbuf
let init (t : t) ~fname =
t.lex_curr_p <-
{ pos_fname = fname
; pos_lnum = 1
; pos_bol = 0
; pos_cnum = 0
}
let from_string s ~fname =
let t = Lexing.from_string s in
init t ~fname;
t
let from_channel ic ~fname =
let t = Lexing.from_channel ic in
init t ~fname;
t