Permalink
Browse files

Lines.Buffer: rename parsing_buffer to make

And improve documentation.
  • Loading branch information...
1 parent b73c2c6 commit f9782684075a86d99192554356170d4bb7f8afdc @agarwal agarwal committed Jan 23, 2013
Showing with 7 additions and 6 deletions.
  1. +3 −3 src/lib/biocaml_lines.ml
  2. +4 −3 src/lib/biocaml_lines.mli
View
@@ -22,7 +22,7 @@ module Buffer = struct
filename : string option;
}
- let parsing_buffer ?filename () =
+ let make ?filename () =
{unfinished_line = None;
lines = Queue.create ();
parsed_lines = 0;
@@ -81,7 +81,7 @@ end
module Transform = struct
let string_to_item () =
- let buf = Buffer.parsing_buffer () in
+ let buf = Buffer.make () in
Biocaml_transform.make ~name:"lines"
~feed:(Buffer.feed_string buf)
~next:(function
@@ -102,7 +102,7 @@ module Transform = struct
()
let make ?name ?filename ~next ~on_error () =
- let lo_parser = Buffer.parsing_buffer ?filename () in
+ let lo_parser = Buffer.make ?filename () in
Biocaml_transform.make ?name ()
~feed:(Buffer.feed_string lo_parser)
~next:(fun stopped ->
@@ -18,9 +18,10 @@ module Buffer : sig
(** The exception thrown by [next_line_exn]. *)
exception No_next_line
- (** Create a "parser"; the optional [filename] is used only to
- create error locations. *)
- val parsing_buffer: ?filename:string -> unit -> t
+ (** Make a new empty buffer. The optional [filename] is used only
+ for error reporting; it should be set to the name of the file,
+ if any, from which you will feed the buffer. *)
+ val make: ?filename:string -> unit -> t
(** Feed the parser with a line. *)
val feed_line: t -> item -> unit

0 comments on commit f978268

Please sign in to comment.