Skip to content

Commit

Permalink
Merge pull request #764 from glondu/fix-ocsigenserver-5.1.0
Browse files Browse the repository at this point in the history
Fix compilation with ocsigenserver 5.1.0
  • Loading branch information
balat committed Sep 25, 2023
2 parents beeaa58 + 2d14e6f commit 2a37de7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion opam
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ depends: [
"lwt_log"
"lwt_ppx" {>= "1.2.3"}
"tyxml" {>= "4.4.0" & < "5.0.0"}
"ocsigenserver" {>= "5.0.0" & < "6.0.0"}
"ocsigenserver" {>= "5.1.0" & < "6.0.0"}
"ipaddr" {>= "2.1"}
"reactiveData" {>= "0.2.1"}
"base-bytes"
Expand Down
8 changes: 4 additions & 4 deletions src/lib/eliom_content_core.server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ module Xml = struct
let empty_name = "" in
empty_name, RAClient (crypto, init, Eliom_lib.to_poly x)

let closing_cdata = Pcre.(regexp (quote "]]>"))
let closing_cdata = Re.Pcre.(regexp (quote "]]>"))

let cdata s =
(* GK *)
Expand All @@ -164,7 +164,7 @@ module Xml = struct
*)
let s' =
"\n<![CDATA[\n"
^ Pcre.replace ~rex:closing_cdata ~itempl:(Pcre.subst "") s
^ Re.replace_string closing_cdata ~by:"" s
^ "\n]]>\n"
in
encodedpcdata s'
Expand All @@ -176,7 +176,7 @@ module Xml = struct
*)
let s' =
"\n//<![CDATA[\n"
^ Pcre.replace ~rex:closing_cdata ~itempl:(Pcre.subst "") s
^ Re.replace_string closing_cdata ~by:"" s
^ "\n//]]>\n"
in
encodedpcdata s'
Expand All @@ -188,7 +188,7 @@ module Xml = struct
*)
let s' =
"\n/* <![CDATA[ */\n"
^ Pcre.replace ~rex:closing_cdata ~itempl:(Pcre.subst "") s
^ Re.replace_string closing_cdata ~by:"" s
^ "\n/* ]]> */\n"
in
encodedpcdata s'
Expand Down
12 changes: 6 additions & 6 deletions src/lib/eliom_parameter.server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,31 @@ let all_suffix_user ?client_to_and_of ~(of_string : string -> 'a)
let regexp reg dest ~to_string n =
user_type
(fun s ->
match Pcre.exec ~rex:reg ~flags:[`ANCHORED] ~pos:0 s with
| _ -> (
match Re.Pcre.exec ~rex:reg ~pos:0 s with
| g when Re.Group.start g 0 = 0 -> (
try
Ocsigen_extensions.replace_user_dir reg
(Ocsigen_extensions.parse_user_dir dest)
s
with Ocsigen_extensions.NoSuchUser ->
raise (Failure "User does not exist"))
| exception Not_found -> raise (Failure "Regexp not matching"))
| _ | exception Not_found -> raise (Failure "Regexp not matching"))
to_string n

let all_suffix_regexp reg dest ~(to_string : 'a -> string) (n : string)
: (string, [`Endsuffix], [`One of string] param_name) params_type
=
all_suffix_user
(fun s ->
match Pcre.exec ~rex:reg ~flags:[`ANCHORED] ~pos:0 s with
| _ -> (
match Re.Pcre.exec ~rex:reg ~pos:0 s with
| g when Re.Group.start g 0 = 0 -> (
try
Ocsigen_extensions.replace_user_dir reg
(Ocsigen_extensions.parse_user_dir dest)
s
with Ocsigen_extensions.NoSuchUser ->
raise (Failure "User does not exist"))
| exception Not_found -> raise (Failure "Regexp not matching"))
| _ | exception Not_found -> raise (Failure "Regexp not matching"))
to_string n

(* Non localized parameters *)
Expand Down
6 changes: 3 additions & 3 deletions src/lib/eliom_parameter.server.mli
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ val type_checker
instead of the service handler. *)

val regexp
: Pcre.regexp
: Re.Pcre.regexp
-> string
-> to_string:(string -> string)
-> string
Expand All @@ -69,12 +69,12 @@ val regexp
the regular expression [r] as parameter, labeled [s], and that will
be rewritten in d. The syntax of regexp is PCRE's one (uses then
[Pcre] bindings). For example: [regexp
(Pcre.regexp "\\[(.* )\\]") "($1)" "myparam"] will match
(Re.Pcre.regexp "\\[(.* )\\]") "($1)" "myparam"] will match
the parameter [myparam=[hello]] and send the string ["(hello)"] to
the service handler. *)

val all_suffix_regexp
: Pcre.regexp
: Re.Pcre.regexp
-> string
-> to_string:(string -> string)
-> string
Expand Down

0 comments on commit 2a37de7

Please sign in to comment.