Skip to content

Commit

Permalink
Merge pull request #312 from ahrefs/ocaml5
Browse files Browse the repository at this point in the history
fix build with OCaml 5 (drops support for 4.02)
  • Loading branch information
Drup authored Mar 21, 2023
2 parents a4a91e7 + 2f2faf3 commit b94bc3e
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 27 deletions.
4 changes: 2 additions & 2 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
(synopsis "Common layer for the JSX and PPX syntaxes for Tyxml")
(depends
(ocaml
(>= 4.02))
(>= 4.03))
(alcotest :with-test)
(ppxlib
(>= 0.18))
Expand All @@ -76,7 +76,7 @@
"TyXML provides a set of convenient combinators that uses the OCaml type system to ensure the validity of the generated documents. TyXML can be used with any representation of HTML and SVG: the textual one, provided directly by this package, or DOM trees (`js_of_ocaml-tyxml`) virtual DOM (`virtual-dom`) and reactive or replicated trees (`eliom`). You can also create your own representation and use it to instantiate a new set of combinators.")
(depends
(ocaml
(>= 4.02))
(>= 4.03))
(alcotest :with-test)
(re
(>= 1.5.0))
Expand Down
10 changes: 0 additions & 10 deletions jsx/tyxml_jsx.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ let is_jsx e =
in
List.exists f e.pexp_attributes

(* When dropping support for 4.02, this module can simply be deleted. *)
module String = struct
include String
let lowercase_ascii = String.lowercase [@ocaml.warning "-3"]
end
module Char = struct
include Char
let lowercase_ascii = Char.lowercase [@ocaml.warning "-3"]
end

let lowercase_lead s =
String.mapi (fun i c -> if i = 0 then Char.lowercase_ascii c else c) s

Expand Down
6 changes: 0 additions & 6 deletions ppx/tyxml_ppx.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@

open Tyxml_syntax

(* When dropping support for 4.02, this module can simply be deleted. *)
module String = struct
include String
let capitalize_ascii = String.capitalize [@ocaml.warning "-3"]
end

open Ppxlib.Asttypes
open Ppxlib.Parsetree

Expand Down
7 changes: 0 additions & 7 deletions syntax/name_convention.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@
see <http://www.w3.org/TR/html51/syntax.html#syntax>
*)

(* When dropping support for 4.02, this module can simply be deleted. *)
module Char = struct
include Char
let lowercase_ascii = Char.lowercase [@ocaml.warning "-3"]
let uppercase_ascii = Char.uppercase [@ocaml.warning "-3"]
end

(* In the ocaml parser:
let identchar = ['A'-'Z' 'a'-'z' '_' '\'' '0'-'9']
*)
Expand Down
2 changes: 1 addition & 1 deletion tyxml-syntax.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ doc: "https://ocsigen.org/tyxml/latest/manual/intro"
bug-reports: "https://github.com/ocsigen/tyxml/issues"
depends: [
"dune" {>= "2.7"}
"ocaml" {>= "4.02"}
"ocaml" {>= "4.03"}
"alcotest" {with-test}
"ppxlib" {>= "0.18"}
"re" {>= "1.5.0"}
Expand Down
2 changes: 1 addition & 1 deletion tyxml.opam
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ doc: "https://ocsigen.org/tyxml/latest/manual/intro"
bug-reports: "https://github.com/ocsigen/tyxml/issues"
depends: [
"dune" {>= "2.7"}
"ocaml" {>= "4.02"}
"ocaml" {>= "4.03"}
"alcotest" {with-test}
"re" {>= "1.5.0"}
"seq"
Expand Down

0 comments on commit b94bc3e

Please sign in to comment.