Skip to content

Commit 71875e0

Browse files
committed
Fix potential shadowing of _ppx_regexp_<n> from open.
1 parent 25254a4 commit 71875e0

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

ppx_regexp.ml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,17 @@ let rewrite_structure _mapper sis =
222222
| [] -> sis'
223223
| bindings ->
224224
clear_bindings ();
225-
let si' = {
226-
pstr_desc = Pstr_value (Nonrecursive, bindings);
227-
pstr_loc = Location.none;
228-
} in
229-
si' :: sis')
225+
let local_sis =
226+
[%str
227+
module Ppx_regexp__local = struct
228+
[%%s [{
229+
pstr_desc = Pstr_value (Nonrecursive, bindings);
230+
pstr_loc = Location.none;
231+
}]]
232+
end
233+
open Ppx_regexp__local]
234+
in
235+
local_sis @ sis')
230236

231237
let () = Driver.register ~name:"ppx_regexp" ocaml_version
232238
(fun _config _cookies -> {default_mapper with structure = rewrite_structure})

0 commit comments

Comments
 (0)