diff --git a/src/lib/sedlexing.mli b/src/lib/sedlexing.mli index 55c439d..5d6d801 100644 --- a/src/lib/sedlexing.mli +++ b/src/lib/sedlexing.mli @@ -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 @@ -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