Up

Module Parse_pos = Sexplib.Sexp.Parse_pos

Signature

type t = Sexplib.Pre_sexp.Parse_pos.t = private {
mutable text_line
: int ; (* Line position in parsed text *)
mutable text_char
: int ; (* Character position in parsed text *)
mutable global_offset
: int ; (* Global/logical offset *)
mutable buf_pos
: int ; (* Read position in string buffer *)
}

Position information after complete parse

val create : ?text_line:int -> ?text_char:int -> ?buf_pos:int -> ?global_offset:int -> unit -> t

create ?text_line ?text_char ?buf_pos ?global_offset ()

Returns a parse position with the given parameters.
Param [text_line] default = 1
Param [text_char] default = 0
Param [global_offset] default = 0
Param [buf_pos] default = 0
val with_buf_pos : t -> int -> t

with_buf_pos t pos

Returns a copy of the parse position t where buf_pos is set to pos.