Module Delimited_kernel__.Parse_state
exception
Bad_csv_formatting of string list * string
Row up to the error, and the field with the error up to the point of failure
val acc : 'a t -> 'a
At any moment, the result of folding over all complete rows seen so far.
val create : ?strip:bool -> ?sep:char -> ?quote:[ `No_quoting | `Using of char ] -> fields_used:int array option -> init:'a -> f:(int -> 'a -> string Delimited_kernel__.Append_only_buffer.t -> 'a) -> unit -> 'a t
val input : 'a t -> ?pos:int -> ?len:int -> Core_kernel.Bytes.t -> 'a t
input t ?pos ?len s
parses the firstlen
characters ofs
, starting at positionpos
.pos
defaults to0
andlen
defaults to reading up to the end ofs
.
val input_string : 'a t -> ?pos:int -> ?len:int -> string -> 'a t
val finish : 'a t -> 'a t
finish t
forces an end-of-row. Raises if end-of-row is not permitted here (e.g., within a quoted field). It is permitted toinput
after afinish
.
val is_at_beginning_of_row : _ t -> bool
Returns true if the parser is at the beginning of a row