From 514ce04784d4ed51611ff8d79e0ae93e176bb66c Mon Sep 17 00:00:00 2001 From: Rodolphe Lepigre Date: Wed, 1 May 2024 08:42:12 +0200 Subject: [PATCH] Drop support for OCaml 4.7 to 4.10. --- .github/workflows/ci.yml | 9 ++++++--- bindlib.opam | 6 +++--- dune-project | 6 +++--- lib/bindlib.ml | 6 ------ lib/dune | 5 ----- lib/pp.ml | 27 --------------------------- 6 files changed, 12 insertions(+), 47 deletions(-) delete mode 100644 lib/pp.ml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45eecca..eade183 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,9 +11,12 @@ jobs: fail-fast: false matrix: ocaml-version: [ - 4.07.0, 4.07.1, 4.08.0, 4.08.1, 4.09.0, 4.09.1, 4.10.0, 4.10.1, - 4.10.2, 4.11.0, 4.11.1, 4.11.2, 4.12.0, 4.13.0, 4.13.1, 4.14.0, - 4.14.1, 5.0.0, 5.1.0, 5.1.1 + 4.11.0, 4.11.1, 4.11.2, + 4.12.0, + 4.13.0, 4.13.1, + 4.14.0, 4.14.1, + 5.0.0, + 5.1.0, 5.1.1 ] runs-on: "ubuntu-latest" steps: diff --git a/bindlib.opam b/bindlib.opam index 9375d10..a63f815 100644 --- a/bindlib.opam +++ b/bindlib.opam @@ -17,10 +17,10 @@ license: "LGPL-3.0" homepage: "https://github.com/rlepigre/ocaml-bindlib" bug-reports: "https://github.com/rlepigre/ocaml-bindlib/issues" depends: [ - "ocaml" {>= "4.07.0"} + "ocaml" {>= "4.11.0"} "dune" {>= "2.7" & build} - "timed" {>= "1.0" & with-test} - "pacomb" {>= "1.1" & with-test} + "timed" {>= "1.1" & with-test} + "pacomb" {>= "1.3" & with-test} "odoc" {with-doc} ] build: [ diff --git a/dune-project b/dune-project index 9e6d1ea..a2026f1 100644 --- a/dune-project +++ b/dune-project @@ -20,8 +20,8 @@ OCaml language. The main application is the representation of types with a binding structure (e.g., abstract syntax trees).") (depends - (ocaml (>= 4.07.0)) + (ocaml (>= 4.11.0)) (dune :build) - (timed (and (>= 1.0) :with-test)) - (pacomb (and (>= 1.1) :with-test)) + (timed (and (>= 1.1) :with-test)) + (pacomb (and (>= 1.3) :with-test)) (odoc :with-doc))) diff --git a/lib/bindlib.ml b/lib/bindlib.ml index 132ef67..98a4f83 100644 --- a/lib/bindlib.ml +++ b/lib/bindlib.ml @@ -11,12 +11,6 @@ let ((reset_counter : unit -> unit), (fresh_key : unit -> int)) = let c = ref (-1) in ((fun () -> c := -1), (fun () -> incr c; !c)) -(* FIXME remove in recent enough OCaml. *) -module Int = struct - type t = int - let compare = (-) -end - module IMap = Map.Make(Int) module SMap = Map.Make(String) diff --git a/lib/dune b/lib/dune index 1dfc1f3..6c80076 100644 --- a/lib/dune +++ b/lib/dune @@ -2,9 +2,4 @@ (name bindlib) (public_name bindlib) (synopsis "An efficient representation of binders") - (preprocess - (action - (run ocaml %{project_root}/lib/pp.ml %{ocaml_version} %{input-file}))) - (preprocessor_deps pp.ml) - (modules bindlib) (wrapped false)) diff --git a/lib/pp.ml b/lib/pp.ml deleted file mode 100644 index 04a68cf..0000000 --- a/lib/pp.ml +++ /dev/null @@ -1,27 +0,0 @@ -(** Preprocessor for removing the "[@@unboxed]" attribute on [Bindlib.any_var] - if the OCaml version is lower that 4.11. *) - -let iter_lines : (string -> unit) -> string -> unit = fun f file -> - let ic = open_in file in - try while true do f (input_line ic) done with End_of_file -> close_in ic - -(** OCaml version given as first command line argument. *) -let version = - match String.split_on_char '.' Sys.argv.(1) with - | major :: minor :: _ -> (int_of_string major, int_of_string minor) - | _ -> assert false - -(** File to process given as second command line argument. *) -let input_file = Sys.argv.(2) - -let print_line : string -> unit = fun line -> - print_string line; print_char '\n' - -let print_line_if_not_unbox : string -> unit = fun line -> - if String.trim line <> "[@@unboxed]" then print_line line - -let _ = - let handle_line = - if version < (4, 11) then print_line_if_not_unbox else print_line - in - iter_lines handle_line input_file