aboutsummaryrefslogtreecommitdiff
path: root/lib/lexbuf.ml
blob: 2ed9099191a5d5718046c04769ec0ba05a7f314e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
type t = Sedlexing.lexbuf

let buffer : t -> Sedlexing.lexbuf = fun t -> t
let start : t -> unit = fun t -> Sedlexing.start t

let positions : t -> Lexing.position * Lexing.position =
 fun t -> Sedlexing.lexing_positions t

let content : t -> string = fun t -> Sedlexing.Utf8.lexeme t
let from_lexbuf : Sedlexing.lexbuf -> t = fun t -> t

let tokenize : (t -> 'a) -> t -> unit -> 'a * Lexing.position * Lexing.position
    =
 fun f lexbuf -> Sedlexing.with_tokenizer f lexbuf