Skip to content

Commit 6d58352

Browse files
committed
Fix invalid AST due to empty binding list in ppx_regexp.
1 parent 9604bc0 commit 6d58352

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v0.5.1 - 2022-06-09
2+
3+
- Fix invalid AST due to empty binding list in `ppx_regexp`.
4+
15
## v0.5.0 - 2022-06-06
26

37
- Migrate `ppx_regexp` to ppxlib.

ppx_regexp/ppx_regexp.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ end
224224

225225
let impl str =
226226
let str, rev_bindings = transformation#structure str [] in
227+
if rev_bindings = [] then str else
227228
let re_str =
228229
let loc = Location.none in
229230
[%str

tests/dune

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@
99

1010
; Tests for ppx_regexp
1111

12-
(executable
13-
(name test_ppx_regexp)
14-
(modules test_ppx_regexp)
12+
(tests
13+
(names test_ppx_regexp test_ppx_regexp_unused)
14+
(modules test_ppx_regexp test_ppx_regexp_unused)
15+
(package ppx_regexp)
1516
(libraries re re.perl)
1617
(preprocess (pps ppx_regexp)))
17-
(alias
18-
(name runtest)
19-
(package ppx_regexp)
20-
(deps test_ppx_regexp.exe)
21-
(action (run %{deps})))
2218

2319
; Tests for ppx_tyre
2420

tests/test_ppx_regexp_unused.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let () = ()

0 commit comments

Comments
 (0)