An OCaml library to parse ZNC logs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
410 B

let from_lexbuf lexbuf =
let next_line () = Lexer.file lexbuf in
let msgs = ref [] in
let rec loop = function
| Some msg ->
msgs := msg :: !msgs ;
loop (next_line ())
| None ->
()
in
loop (next_line ()) ;
List.rev !msgs
let from_channel chan = from_lexbuf (Sedlexing.Utf8.from_channel chan)
let from_string string = from_lexbuf (Sedlexing.Utf8.from_string string)