Skip to content

Commit 4345df6

Browse files
committed
Drop Stream API that was removed in OCaml 4.14.0 ahead of the 5.0 release.
1 parent 96cffd2 commit 4345df6

File tree

5 files changed

+6
-28
lines changed

5 files changed

+6
-28
lines changed

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
3.0:
2+
* Dropped `Stream` api which was removed in `4.14.0` ahead of the `5.0`
3+
release.
4+
15
2.6:
26
* Adapted to ppxlib `0.26`, thanks to @pitag-ha
37

dune-project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(lang dune 2.8)
2-
(version 2.6)
2+
(version 3.0)
33
(name sedlex)
44
(source (github ocaml-community/sedlex))
55
(license MIT)

sedlex.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is generated by dune, edit dune-project instead
22
opam-version: "2.0"
3-
version: "2.6"
3+
version: "3.0"
44
synopsis: "An OCaml lexer generator for Unicode"
55
description: """
66
sedlex is a lexer generator for OCaml. It is similar to ocamllex, but supports

src/lib/sedlexing.ml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ let gen_of_channel chan =
1111

1212
let ( >>= ) o f = match o with Some x -> f x | None -> None
1313

14-
(* For legacy purposes. *)
15-
let gen_of_stream stream =
16-
let f () = try Some (Stream.next stream) with Stream.Failure -> None in
17-
f
18-
1914
(* Absolute position from the beginning of the stream *)
2015
type apos = int
2116

@@ -95,7 +90,6 @@ let fill_buf_from_gen f gen buf pos len =
9590
aux 0
9691

9792
let from_gen s = create (fill_buf_from_gen (fun id -> id) s)
98-
let from_stream s = from_gen @@ gen_of_stream s
9993

10094
let from_int_array a =
10195
let len = Array.length a in
@@ -224,7 +218,6 @@ let with_tokenizer lexer' lexbuf =
224218

225219
module Latin1 = struct
226220
let from_gen s = create (fill_buf_from_gen Uchar.of_char s)
227-
let from_stream s = from_gen @@ gen_of_stream s
228221

229222
let from_string s =
230223
let len = String.length s in
@@ -403,7 +396,6 @@ module Utf8 = struct
403396
let from_gen s =
404397
create (fill_buf_from_gen (fun id -> id) (Helper.gen_from_char_gen s))
405398

406-
let from_stream s = from_gen @@ gen_of_stream s
407399
let from_string s = from_int_array (Helper.to_int_array s 0 (String.length s))
408400

409401
let sub_lexeme lexbuf pos len =
@@ -520,7 +512,6 @@ module Utf16 = struct
520512
end
521513

522514
let from_gen s opt_bo = from_gen (Helper.gen_from_char_gen opt_bo s)
523-
let from_stream s = from_gen @@ gen_of_stream s
524515
let from_channel ic opt_bo = from_gen (gen_of_channel ic) opt_bo
525516

526517
let from_string s opt_bo =

src/lib/sedlexing.mli

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ val set_filename : lexbuf -> string -> unit
6161
(** Create a lexbuf from a stream of Unicode code points. *)
6262
val from_gen : Uchar.t Gen.t -> lexbuf
6363

64-
(** Create a lexbuf from a stream of Unicode code points. *)
65-
val from_stream : Uchar.t Stream.t -> lexbuf
66-
[@@ocaml.deprecated "Use [Sedlexing.from_gen] instead."]
67-
6864
(** Create a lexbuf from an array of Unicode code points. *)
6965
val from_int_array : int array -> lexbuf
7066

@@ -186,11 +182,6 @@ module Latin1 : sig
186182
of Unicode code points in the range [0..255]) *)
187183
val from_gen : char Gen.t -> lexbuf
188184

189-
(** Create a lexbuf from a Latin1 encoded stream (ie a stream
190-
of Unicode code points in the range [0..255]) *)
191-
val from_stream : char Stream.t -> lexbuf
192-
[@@ocaml.deprecated "Use [Sedlexing.Latin1.from_gen] instead."]
193-
194185
(** Create a lexbuf from a Latin1 encoded input channel.
195186
The client is responsible for closing the channel. *)
196187
val from_channel : in_channel -> lexbuf
@@ -218,10 +209,6 @@ module Utf8 : sig
218209
(** Create a lexbuf from a UTF-8 encoded stream. *)
219210
val from_gen : char Gen.t -> lexbuf
220211

221-
(** Create a lexbuf from a UTF-8 encoded stream. *)
222-
val from_stream : char Stream.t -> lexbuf
223-
[@@ocaml.deprecated "Use [Sedlexing.Utf8.from_gen] instead."]
224-
225212
(** Create a lexbuf from a UTF-8 encoded input channel. *)
226213
val from_channel : in_channel -> lexbuf
227214

@@ -248,10 +235,6 @@ module Utf16 : sig
248235
Utf16.InvalidCodepoint. *)
249236
val from_gen : char Gen.t -> byte_order option -> lexbuf
250237

251-
(** Works as [Utf16.from_gen] with a [stream]. *)
252-
val from_stream : char Stream.t -> byte_order option -> lexbuf
253-
[@@ocaml.deprecated "Use [Sedlexing.Utf16.from_gen] instead."]
254-
255238
(** Works as [Utf16.from_gen] with an [in_channel]. *)
256239
val from_channel : in_channel -> byte_order option -> lexbuf
257240

0 commit comments

Comments
 (0)