package stdune

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file lexbuf.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
OCaml

Innovation. Community. Security.