Skip to content

Commit e3f2d2e

Browse files
committed
Prepare for the upcoming re 1.7.2.
1 parent eb7e62c commit e3f2d2e

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes
22

3+
## v0.3.2 - 2018-03-01
4+
5+
- Prepare for re 1.7.2.
6+
37
## v0.3.1 - 2017-08-21
48

59
- Fix accidental shadowing of open from another interface-less module using

ppx_regexp.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ let extract_bindings ~loc p =
110110
in
111111
let bs, nG = parse_first () in
112112
let re_str = Buffer.contents buf in
113-
(try ignore (Re_pcre.regexp re_str) with
114-
| Re_perl.Not_supported -> error ~loc "Unsupported regular expression."
115-
| Re_perl.Parse_error -> error ~loc "Invalid regular expression.");
113+
(try ignore Re.Perl.(compile (re re_str)) with
114+
| Re.Perl.Not_supported -> error ~loc "Unsupported regular expression."
115+
| Re.Perl.Parse_error -> error ~loc "Invalid regular expression.");
116116
(Exp.constant (Const.string re_str), bs, nG)
117117

118118
let rec wrap_group_bindings ~loc rhs offG = function
@@ -176,7 +176,7 @@ let transform_cases ~loc cases =
176176
let cases = List.rev_map aux cases in
177177
let res = Exp.array (List.map (fun (re, _, _, _) -> re) cases) in
178178
let comp = [%expr
179-
let a = Array.map (fun s -> Re.mark (Re_pcre.re s)) [%e res] in
179+
let a = Array.map (fun s -> Re.mark (Re.Perl.re s)) [%e res] in
180180
let marks = Array.map fst a in
181181
let re = Re.compile (Re.alt (Array.to_list (Array.map snd a))) in
182182
(re, marks)

ppx_regexp.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build: ["jbuilder" "build" "--root" "." "-j" jobs "@install"]
99
depends: [
1010
"jbuilder" {build}
1111
"ocaml-migrate-parsetree"
12-
"re"
12+
"re" {>= "1.7.1"}
1313
"ppx_tools_versioned" {build}
1414
]
1515
available: [ocaml-version >= "4.02.3"]

0 commit comments

Comments
 (0)