Skip to content

Commit

Permalink
Doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
toots committed Jun 27, 2023
1 parent 01b148e commit 0cde180
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/lib/sedlexing.mli
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,18 @@ exception MalFormed
Uchars [a], a position [pos] and a code point count [n]. The
function should put [n] code points or less in [a], starting at
position [pos], and return the number of characters provided. A
return value of 0 means end of input. *)
return value of 0 means end of input. [bytes_per_char] argument is
optional. If unspecified, byte positions are the same as code point
position. *)
val create :
?bytes_per_char:(Uchar.t -> int) ->
(Uchar.t array -> int -> int -> int) ->
lexbuf

(** set the initial tracked input position for [lexbuf].
(** set the initial tracked input position, in code point, for [lexbuf].
If set to [Lexing.dummy_pos], Sedlexing will not track position
information for you. *)
information for you. [bytes_position] is optional. If unspecified,
byte postion is set to the same value as code point position. *)
val set_position :
?bytes_position:Lexing.position -> lexbuf -> Lexing.position -> unit

Expand All @@ -62,13 +65,16 @@ val set_position :
returned {!Lexing.position} records. *)
val set_filename : lexbuf -> string -> unit

(** Create a lexbuf from a stream of Unicode code points. *)
(** Create a lexbuf from a stream of Unicode code points. [bytes_per_char] is
optional. If unspecified, byte positions are the same as code point positions. *)
val from_gen : ?bytes_per_char:(Uchar.t -> int) -> Uchar.t Gen.t -> lexbuf

(** Create a lexbuf from an array of Unicode code points. *)
(** Create a lexbuf from an array of Unicode code points. [bytes_per_char] is
optional. If unspecified, byte positions are the same as code point positions. *)
val from_int_array : ?bytes_per_char:(Uchar.t -> int) -> int array -> lexbuf

(** Create a lexbuf from an array of Unicode code points. *)
(** Create a lexbuf from an array of Unicode code points. [bytes_per_char] is
optional. If unspecified, byte positions are the same as code point positions. *)
val from_uchar_array :
?bytes_per_char:(Uchar.t -> int) -> Uchar.t array -> lexbuf

Expand Down

0 comments on commit 0cde180

Please sign in to comment.