1diff --git a/comby-kernel.opam b/comby-kernel.opam
2index 9db7cc5..a497bff 100644
3--- a/comby-kernel.opam
4+++ b/comby-kernel.opam
5@@ -20,7 +20,7 @@ build: [
6 depends: [
7 "dune" {>= "2.8.0"}
8 "ocaml" {>= "4.08.1"}
9- "core_kernel"
10+ "core_kernel" {>= "v0.15.0"}
11 "mparser" {>= "1.3"}
12 "mparser-pcre"
13 "ppx_deriving"
14diff --git a/comby-semantic.opam b/comby-semantic.opam
15index 88563f6..fbbc122 100644
16--- a/comby-semantic.opam
17+++ b/comby-semantic.opam
18@@ -20,7 +20,7 @@ build: [
19 depends: [
20 "dune" {>= "2.8.0"}
21 "ocaml" {>= "4.08.1"}
22- "core_kernel"
23+ "core_kernel" {>= "v0.15.0"}
24 "ppx_deriving"
25 "lwt"
26 "cohttp"
27diff --git a/comby.opam b/comby.opam
28index 9e5d96b..ecab789 100644
29--- a/comby.opam
30+++ b/comby.opam
31@@ -31,7 +31,7 @@ depends: [
32 "cohttp-lwt-unix"
33 "comby-kernel" {= "1.7.0"}
34 "comby-semantic" {= "1.7.0"}
35- "core"
36+ "core" {>= "v0.15.0"}
37 "hack_parallel" {arch != "arm32" & arch != "arm64"}
38 "lwt"
39 "lwt_react"
40diff --git a/lib/app/configuration/command_configuration.ml b/lib/app/configuration/command_configuration.ml
41index 75c3107..418276e 100644
42--- a/lib/app/configuration/command_configuration.ml
43+++ b/lib/app/configuration/command_configuration.ml
44@@ -16,21 +16,21 @@ type 'a next =
45
46 let fold_directory ?(sorted=false) root ~init ~f =
47 let rec aux acc absolute_path depth =
48- if Sys.is_file absolute_path = `Yes then
49+ if Sys_unix.is_file absolute_path = `Yes then
50 match f acc ~depth ~absolute_path ~is_file:true with
51 | Continue acc
52 | Skip acc -> acc
53- else if Sys.is_directory absolute_path = `Yes then
54+ else if Sys_unix.is_directory absolute_path = `Yes then
55 match f acc ~depth ~absolute_path ~is_file:false with
56 | Skip acc -> acc
57 | Continue acc ->
58 let dir_contents =
59 if Option.is_some (Sys.getenv "COMBY_TEST") || sorted then
60- Sys.ls_dir absolute_path
61+ Sys_unix.ls_dir absolute_path
62 |> List.sort ~compare:String.compare
63 |> List.rev
64 else
65- Sys.ls_dir absolute_path
66+ Sys_unix.ls_dir absolute_path
67 in
68 List.fold dir_contents ~init:acc ~f:(fun acc subdir ->
69 aux acc (Filename.concat absolute_path subdir) (depth + 1))
70@@ -50,8 +50,8 @@ let parse_source_directories
71 let exact_file_paths, file_patterns =
72 List.partition_map file_filters ~f:(fun path ->
73 let is_exact path =
74- (String.contains path '/' && Sys.is_file path = `Yes)
75- || (Sys.is_file ("." ^/ path) = `Yes) (* See if it matches something in the current directory *)
76+ (String.contains path '/' && Sys_unix.is_file path = `Yes)
77+ || (Sys_unix.is_file ("." ^/ path) = `Yes) (* See if it matches something in the current directory *)
78 in
79 if is_exact path then Either.First path else Either.Second path)
80 in
81@@ -167,8 +167,8 @@ let parse_templates ?metasyntax ?(warn_for_missing_file_in_dir = false) paths =
82 let f acc ~depth:_ ~absolute_path ~is_file =
83 let is_leaf_directory absolute_path =
84 not is_file &&
85- Sys.ls_dir absolute_path
86- |> List.for_all ~f:(fun path -> Sys.is_directory (absolute_path ^/ path) = `No)
87+ Sys_unix.ls_dir absolute_path
88+ |> List.for_all ~f:(fun path -> Sys_unix.is_directory (absolute_path ^/ path) = `No)
89 in
90 if is_leaf_directory absolute_path then
91 match parse_directory absolute_path with
92@@ -178,7 +178,7 @@ let parse_templates ?metasyntax ?(warn_for_missing_file_in_dir = false) paths =
93 Continue acc
94 in
95 List.concat_map paths ~f:(fun path ->
96- if Sys.is_directory path = `Yes then
97+ if Sys_unix.is_directory path = `Yes then
98 fold_directory path ~sorted:true ~init:[] ~f
99 else
100 parse_toml ?metasyntax path)
101@@ -428,7 +428,7 @@ let parse_metasyntax metasyntax_path =
102 match metasyntax_path with
103 | None -> Matchers.Metasyntax.default_metasyntax
104 | Some metasyntax_path ->
105- match Sys.file_exists metasyntax_path with
106+ match Sys_unix.file_exists metasyntax_path with
107 | `No | `Unknown ->
108 Format.eprintf "Could not open file: %s@." metasyntax_path;
109 exit 1
110@@ -477,14 +477,14 @@ let emit_errors { input_options; output_options; _ } =
111 ; Option.is_some input_options.directory_depth
112 && Option.value_exn (input_options.directory_depth) < 0
113 , "-depth must be 0 or greater."
114- ; Sys.is_directory input_options.target_directory = `No
115+ ; Sys_unix.is_directory input_options.target_directory = `No
116 , "Directory specified with -d or -directory is not a directory."
117 ; output_options.json_only_diff && not output_options.json_lines
118 , "-json-only-diff can only be supplied with -json-lines."
119 ; (Option.is_some output_options.chunk_matches) && Option.is_some input_options.zip_file
120 , "chunk-matches output format is not supported for zip files."
121 ; Option.is_some output_options.interactive_review &&
122- (not (String.equal input_options.target_directory (Sys.getcwd ())))
123+ (not (String.equal input_options.target_directory (Sys_unix.getcwd ())))
124 , "Please remove the -d option and `cd` to the directory where you want to \
125 review from. The -review, -editor, or -default-no options should only be run \
126 at the root directory of the project files to patch."
127@@ -492,11 +492,11 @@ let emit_errors { input_options; output_options; _ } =
128 match input_options.templates with
129 | Some inputs ->
130 List.find_map inputs ~f:(fun input ->
131- if Sys.is_file input = `Yes then
132+ if Sys_unix.is_file input = `Yes then
133 (match Toml.Parser.from_filename input with
134 | `Error (s, _) -> Some s
135 | _ -> None)
136- else if not (Sys.is_directory input = `Yes) then
137+ else if not (Sys_unix.is_directory input = `Yes) then
138 Some (Format.sprintf "Directory %S specified with -templates is not a directory." input)
139 else
140 None)
141@@ -611,7 +611,7 @@ let filter_zip_entries file_filters exclude_directory_prefix exclude_file_prefix
142
143 let syntax custom_matcher_path =
144 match
145- Sys.file_exists custom_matcher_path with
146+ Sys_unix.file_exists custom_matcher_path with
147 | `No | `Unknown ->
148 Format.eprintf "Could not open file: %s@." custom_matcher_path;
149 exit 1
150@@ -795,7 +795,7 @@ let create
151 | Directory ->
152 let target_directory =
153 if target_directory = "." then
154- Filename.realpath target_directory
155+ Filename_unix.realpath target_directory
156 else
157 target_directory
158 in
159diff --git a/lib/app/configuration/dune b/lib/app/configuration/dune
160index e0f9748..e417cfe 100644
161--- a/lib/app/configuration/dune
162+++ b/lib/app/configuration/dune
163@@ -1,6 +1,21 @@
164 (library
165- (name configuration)
166- (public_name comby.configuration)
167- (instrumentation (backend bisect_ppx))
168- (preprocess (pps ppx_deriving.show ppx_sexp_conv ppx_sexp_message ppx_deriving_yojson))
169- (libraries comby-kernel comby-semantic comby.patdiff comby.camlzip core yojson ppx_deriving_yojson toml lwt lwt.unix tar tar-unix))
170+ (name configuration)
171+ (public_name comby.configuration)
172+ (instrumentation
173+ (backend bisect_ppx))
174+ (preprocess
175+ (pps ppx_deriving.show ppx_sexp_conv ppx_sexp_message ppx_deriving_yojson))
176+ (libraries
177+ comby-kernel
178+ comby-semantic
179+ comby.patdiff
180+ comby.camlzip
181+ core
182+ core_unix.sys_unix
183+ yojson
184+ ppx_deriving_yojson
185+ toml
186+ lwt
187+ lwt.unix
188+ tar
189+ tar-unix))
190diff --git a/lib/app/configuration/external_semantic.ml b/lib/app/configuration/external_semantic.ml
191index bdc7051..ac69b1b 100644
192--- a/lib/app/configuration/external_semantic.ml
193+++ b/lib/app/configuration/external_semantic.ml
194@@ -2,13 +2,10 @@ open Core_kernel
195
196 open Comby_semantic
197
198-let debug =
199- match Sys.getenv "DEBUG_COMBY" with
200- | exception Not_found -> false
201- | _ -> true
202+let debug = Sys.getenv "DEBUG_COMBY" |> Option.is_some
203
204 let lsif_hover ~name:_ ~filepath ~line ~column =
205- String.chop_prefix_if_exists filepath ~prefix:(Sys.getcwd ()) |> fun filepath_relative_root ->
206+ String.chop_prefix_if_exists filepath ~prefix:(Sys_unix.getcwd ()) |> fun filepath_relative_root ->
207 if debug then Format.printf "File relative root: %s@." filepath;
208 if debug then Format.printf "Querying type at %d::%d@." line column;
209 let context =
210diff --git a/lib/app/dune b/lib/app/dune
211index 2ed553c..a91f826 100644
212--- a/lib/app/dune
213+++ b/lib/app/dune
214@@ -1,9 +1,8 @@
215 (library
216- (name comby)
217- (public_name comby)
218- (instrumentation (backend bisect_ppx))
219- (preprocess (pps ppx_deriving.show ppx_deriving.eq ppx_sexp_conv))
220- (libraries
221- core
222- comby-kernel
223- comby.pipeline))
224+ (name comby)
225+ (public_name comby)
226+ (instrumentation
227+ (backend bisect_ppx))
228+ (preprocess
229+ (pps ppx_deriving.show ppx_deriving.eq ppx_sexp_conv))
230+ (libraries core comby-kernel comby.pipeline))
231diff --git a/lib/app/interactive/dune b/lib/app/interactive/dune
232index 815aff5..63c1757 100644
233--- a/lib/app/interactive/dune
234+++ b/lib/app/interactive/dune
235@@ -1,5 +1,12 @@
236 (library
237- (name interactive)
238- (public_name comby.interactive)
239- (preprocess (pps ppx_sexp_conv))
240- (libraries comby-kernel comby.configuration core shell.filename_extended lwt lwt.unix))
241+ (name interactive)
242+ (public_name comby.interactive)
243+ (preprocess
244+ (pps ppx_sexp_conv))
245+ (libraries
246+ comby-kernel
247+ comby.configuration
248+ core
249+ shell.filename_extended
250+ lwt
251+ lwt.unix))
252diff --git a/lib/app/interactive/interactive.ml b/lib/app/interactive/interactive.ml
253index d4bf200..b27105a 100644
254--- a/lib/app/interactive/interactive.ml
255+++ b/lib/app/interactive/interactive.ml
256@@ -1,5 +1,6 @@
257 open Core
258 open Lwt
259+module Unix = Core_unix
260
261 open Configuration
262
263@@ -37,6 +38,7 @@ module Diff = struct
264 ~big_enough:line_big_enough
265 ~prev
266 ~next
267+ ()
268 | Some prog ->
269 let compare x y =
270 let cmd = sprintf "%s %S %S" prog x y in
271@@ -52,7 +54,7 @@ module Diff = struct
272 let compare = compare
273 end)
274 in
275- P.get_hunks ~transform ~context ~big_enough:line_big_enough ~prev ~next
276+ P.get_hunks ~transform ~context ~big_enough:line_big_enough ~prev ~next ()
277 in
278 match float_tolerance with
279 | None -> hunks
280diff --git a/lib/app/pipeline/dune b/lib/app/pipeline/dune
281index 3369b9e..e6ec880 100644
282--- a/lib/app/pipeline/dune
283+++ b/lib/app/pipeline/dune
284@@ -1,11 +1,23 @@
285 (library
286- (name pipeline)
287- (public_name comby.pipeline)
288- (instrumentation (backend bisect_ppx))
289- (preprocess (pps ppx_sexp_conv ppx_deriving_yojson))
290- (libraries comby-kernel comby.statistics comby.configuration comby.interactive comby.camlzip core core.uuid yojson ppx_deriving_yojson parany
291- (select parallel_hack.ml from
292- (hack_parallel -> parallel_hack.available.ml)
293- (!hack_parallel -> parallel_hack.parany_fallback.ml))
294- ))
295-
296+ (name pipeline)
297+ (public_name comby.pipeline)
298+ (instrumentation
299+ (backend bisect_ppx))
300+ (preprocess
301+ (pps ppx_sexp_conv ppx_deriving_yojson))
302+ (libraries
303+ comby-kernel
304+ comby.statistics
305+ comby.configuration
306+ comby.interactive
307+ comby.camlzip
308+ core
309+ core_unix.uuid
310+ yojson
311+ ppx_deriving_yojson
312+ parany
313+ (select
314+ parallel_hack.ml
315+ from
316+ (hack_parallel -> parallel_hack.available.ml)
317+ (!hack_parallel -> parallel_hack.parany_fallback.ml))))
318diff --git a/lib/app/pipeline/parallel_hack.available.ml b/lib/app/pipeline/parallel_hack.available.ml
319index a901eea..ad33070 100644
320--- a/lib/app/pipeline/parallel_hack.available.ml
321+++ b/lib/app/pipeline/parallel_hack.available.ml
322@@ -1,4 +1,5 @@
323 open Core
324+module Unix = Core_unix
325
326 open Hack_parallel
327
328diff --git a/lib/app/statistics/dune b/lib/app/statistics/dune
329index b14d5b1..12aff7f 100644
330--- a/lib/app/statistics/dune
331+++ b/lib/app/statistics/dune
332@@ -1,6 +1,8 @@
333 (library
334- (name statistics)
335- (public_name comby.statistics)
336- (instrumentation (backend bisect_ppx))
337- (preprocess (pps ppx_deriving_yojson))
338- (libraries yojson ppx_deriving_yojson ppx_deriving_yojson.runtime))
339+ (name statistics)
340+ (public_name comby.statistics)
341+ (instrumentation
342+ (backend bisect_ppx))
343+ (preprocess
344+ (pps ppx_deriving_yojson))
345+ (libraries yojson ppx_deriving_yojson ppx_deriving_yojson.runtime))
346diff --git a/lib/app/vendored/patdiff/kernel/src/dune b/lib/app/vendored/patdiff/kernel/src/dune
347index 7a6353d..b79cba2 100644
348--- a/lib/app/vendored/patdiff/kernel/src/dune
349+++ b/lib/app/vendored/patdiff/kernel/src/dune
350@@ -1,3 +1,6 @@
351-(library (name patdiff_kernel) (public_name comby.patdiff_kernel)
352+(library
353+ (name patdiff_kernel)
354+ (public_name comby.patdiff_kernel)
355 (libraries core_kernel.composition_infix core_kernel patience_diff re)
356- (preprocess (pps ppx_jane)))
357+ (preprocess
358+ (pps ppx_jane)))
359diff --git a/lib/app/vendored/patdiff/kernel/src/patdiff_core.ml b/lib/app/vendored/patdiff/kernel/src/patdiff_core.ml
360index 4f53a0b..88ee0e3 100644
361--- a/lib/app/vendored/patdiff/kernel/src/patdiff_core.ml
362+++ b/lib/app/vendored/patdiff/kernel/src/patdiff_core.ml
363@@ -138,6 +138,7 @@ module Make (Output_impls : Output_impls) = struct
364 ~big_enough:line_big_enough
365 ~prev
366 ~next
367+ ()
368 ;;
369
370 type word_or_newline =
371@@ -345,6 +346,7 @@ module Make (Output_impls : Output_impls) = struct
372 ~big_enough:word_big_enough
373 ~prev:prev_pieces
374 ~next:next_pieces
375+ ()
376 ;;
377
378 let ranges_are_just_whitespace (ranges : _ Patience_diff.Range.t list) =
379diff --git a/lib/app/vendored/patdiff/lib/src/compare_core.ml b/lib/app/vendored/patdiff/lib/src/compare_core.ml
380index fafb201..8b40d09 100644
381--- a/lib/app/vendored/patdiff/lib/src/compare_core.ml
382+++ b/lib/app/vendored/patdiff/lib/src/compare_core.ml
383@@ -1,5 +1,6 @@
384 open! Core
385 open! Import
386+module Unix = Core_unix
387
388 let lines_of_contents contents =
389 let lines = Array.of_list (String.split_lines contents) in
390@@ -100,6 +101,7 @@ let compare_lines (config : Configuration.t) ?prev_diff ?next_diff ~prev ~next (
391 ~big_enough:line_big_enough
392 ~prev
393 ~next
394+ ()
395 | Some prog ->
396 let compare x y =
397 let cmd = sprintf "%s %S %S" prog x y in
398@@ -116,7 +118,7 @@ let compare_lines (config : Configuration.t) ?prev_diff ?next_diff ~prev ~next (
399 let compare = compare
400 end)
401 in
402- P.get_hunks ~transform ~context ~big_enough:line_big_enough ~prev ~next
403+ P.get_hunks ~transform ~context ~big_enough:line_big_enough ~prev ~next ()
404 in
405 let hunks =
406 match config.float_tolerance with
407@@ -361,7 +363,7 @@ let rec diff_dirs_internal (config : Configuration.t) ~prev_dir ~next_dir ~file_
408 | None -> Fn.const true
409 | Some file_filter -> file_filter
410 in
411- Sys.ls_dir (File_name.real_name_exn dir)
412+ Sys_unix.ls_dir (File_name.real_name_exn dir)
413 |> List.filter ~f:(fun x ->
414 let x = File_name.real_name_exn dir ^/ x in
415 match Unix.stat x with
416diff --git a/lib/app/vendored/patdiff/lib/src/compare_core.mli b/lib/app/vendored/patdiff/lib/src/compare_core.mli
417index e919512..caa8dcb 100644
418--- a/lib/app/vendored/patdiff/lib/src/compare_core.mli
419+++ b/lib/app/vendored/patdiff/lib/src/compare_core.mli
420@@ -1,5 +1,6 @@
421 open! Core
422 open! Import
423+module Unix = Core_unix
424
425 val diff_files
426 : Configuration.t
427diff --git a/lib/app/vendored/patdiff/lib/src/configuration.ml b/lib/app/vendored/patdiff/lib/src/configuration.ml
428index 6879daa..7d59706 100644
429--- a/lib/app/vendored/patdiff/lib/src/configuration.ml
430+++ b/lib/app/vendored/patdiff/lib/src/configuration.ml
431@@ -481,7 +481,7 @@ let rec load_exn' ~set config_file =
432 | Error _another_exn -> raise exn
433 | Ok c ->
434 (let new_file = config_file ^ ".new" in
435- match Sys.file_exists new_file with
436+ match Sys_unix.file_exists new_file with
437 | `Yes | `Unknown -> ()
438 | `No ->
439 (try Sexp.save_hum new_file (On_disk.V1.sexp_of_t c) with
440@@ -564,7 +564,7 @@ let get_config ?filename () =
441 (* ~/.patdiff exists *)
442 Option.bind (Sys.getenv "HOME") ~f:(fun home ->
443 let f = home ^/ ".patdiff" in
444- match Sys.file_exists f with
445+ match Sys_unix.file_exists f with
446 | `Yes -> Some f
447 | `No | `Unknown -> None)
448 in
449diff --git a/lib/app/vendored/patdiff/lib/src/dune b/lib/app/vendored/patdiff/lib/src/dune
450index 007acad..b6a0f80 100644
451--- a/lib/app/vendored/patdiff/lib/src/dune
452+++ b/lib/app/vendored/patdiff/lib/src/dune
453@@ -1,4 +1,13 @@
454-(library (name patdiff) (public_name comby.patdiff)
455- (libraries core_kernel.composition_infix core core.linux_ext comby.patdiff_kernel
456+(library
457+ (name patdiff)
458+ (public_name comby.patdiff)
459+ (libraries
460+ core_kernel.composition_infix
461+ core
462+ core_unix
463+ core_unix.linux_ext
464+ core_unix.sys_unix
465+ comby.patdiff_kernel
466 patience_diff)
467- (preprocess (pps ppx_jane)))
468+ (preprocess
469+ (pps ppx_jane)))
470diff --git a/lib/app/vendored/patdiff/lib/src/html_output.ml b/lib/app/vendored/patdiff/lib/src/html_output.ml
471index 3d08f91..93ae8af 100644
472--- a/lib/app/vendored/patdiff/lib/src/html_output.ml
473+++ b/lib/app/vendored/patdiff/lib/src/html_output.ml
474@@ -1,5 +1,6 @@
475 open! Core
476 open! Import
477+module Unix = Core_unix
478
479 include Patdiff_kernel.Html_output.Private.Make (struct
480 let mtime file =
481diff --git a/lib/kernel/match/dune b/lib/kernel/match/dune
482index 03b120a..4d48b61 100644
483--- a/lib/kernel/match/dune
484+++ b/lib/kernel/match/dune
485@@ -1,6 +1,12 @@
486 (library
487- (name match)
488- (public_name comby-kernel.match)
489- (instrumentation (backend bisect_ppx))
490- (preprocess (pps ppx_deriving.eq ppx_sexp_conv ppx_deriving_yojson))
491- (libraries core_kernel yojson ppx_deriving_yojson ppx_deriving_yojson.runtime))
492+ (name match)
493+ (public_name comby-kernel.match)
494+ (instrumentation
495+ (backend bisect_ppx))
496+ (preprocess
497+ (pps ppx_deriving.eq ppx_sexp_conv ppx_deriving_yojson))
498+ (libraries
499+ core_kernel
500+ yojson
501+ ppx_deriving_yojson
502+ ppx_deriving_yojson.runtime))
503diff --git a/lib/kernel/matchers/alpha.ml b/lib/kernel/matchers/alpha.ml
504index d6116f7..993aafc 100644
505--- a/lib/kernel/matchers/alpha.ml
506+++ b/lib/kernel/matchers/alpha.ml
507@@ -13,20 +13,11 @@ module R = MakeRegexp(Regexp)
508 let configuration_ref = ref (Configuration.create ())
509 let weaken_delimiter_hole_matching = false
510
511-let debug =
512- match Sys.getenv "DEBUG_COMBY" with
513- | exception Not_found -> false
514- | _ -> true
515+let debug = Sys.getenv "DEBUG_COMBY" |> Option.is_some
516
517-let debug_hole =
518- match Sys.getenv "DEBUG_COMBY_HOLE" with
519- | exception Not_found -> false
520- | _ -> true
521+let debug_hole = Sys.getenv "DEBUG_COMBY_HOLE" |> Option.is_some
522
523-let debug_position =
524- match Sys.getenv "DEBUG_COMBY_POS" with
525- | exception Not_found -> false
526- | _ -> true
527+let debug_position = Sys.getenv "DEBUG_COMBY_POS" |> Option.is_some
528
529 let f _ = return Types.Unit
530
531@@ -147,7 +138,7 @@ module Make (Lang : Types.Language.S) (Meta : Types.Metasyntax.S) (Ext : Types.E
532 ]
533 >>= fun _ -> f Types.Unit
534
535- let sequence_chain (plist : ('c, Match.t) parser sexp_list) : ('c, Match.t) parser =
536+ let sequence_chain (plist : ('c, Match.t) parser list) : ('c, Match.t) parser =
537 List.fold plist ~init:(return Types.Unit) ~f:(>>)
538
539 let with_debug_matcher s tag =
540diff --git a/lib/kernel/matchers/dune b/lib/kernel/matchers/dune
541index 12ed326..4625458 100644
542--- a/lib/kernel/matchers/dune
543+++ b/lib/kernel/matchers/dune
544@@ -1,6 +1,18 @@
545 (library
546- (name matchers)
547- (public_name comby-kernel.matchers)
548- (instrumentation (backend bisect_ppx))
549- (preprocess (pps ppx_here ppx_sexp_conv ppx_sexp_message ppx_deriving_yojson))
550- (libraries comby-kernel.replacement comby-kernel.parsers comby-kernel.match comby-kernel.vangstrom core_kernel mparser mparser-pcre re yojson ppx_deriving_yojson))
551+ (name matchers)
552+ (public_name comby-kernel.matchers)
553+ (instrumentation
554+ (backend bisect_ppx))
555+ (preprocess
556+ (pps ppx_here ppx_sexp_conv ppx_sexp_message ppx_deriving_yojson))
557+ (libraries
558+ comby-kernel.replacement
559+ comby-kernel.parsers
560+ comby-kernel.match
561+ comby-kernel.vangstrom
562+ core_kernel
563+ mparser
564+ mparser-pcre
565+ re
566+ yojson
567+ ppx_deriving_yojson))
568diff --git a/lib/kernel/matchers/evaluate.ml b/lib/kernel/matchers/evaluate.ml
569index 9ea71a0..288f79a 100644
570--- a/lib/kernel/matchers/evaluate.ml
571+++ b/lib/kernel/matchers/evaluate.ml
572@@ -3,10 +3,7 @@ open Core_kernel
573 open Match
574 open Types.Ast
575
576-let debug =
577- match Sys.getenv "DEBUG_COMBY" with
578- | exception Not_found -> false
579- | _ -> true
580+let debug = Sys.getenv "DEBUG_COMBY" |> Option.is_some
581
582 type result = bool * Match.environment option
583
584diff --git a/lib/kernel/matchers/omega.ml b/lib/kernel/matchers/omega.ml
585index 61cc69a..0bef682 100644
586--- a/lib/kernel/matchers/omega.ml
587+++ b/lib/kernel/matchers/omega.ml
588@@ -32,15 +32,9 @@ let push_source_ref : string ref = ref ""
589
590 let filepath_ref : string option ref = ref None
591
592-let debug =
593- match Sys.getenv "DEBUG_COMBY" with
594- | exception Not_found -> false
595- | _ -> true
596-
597-let rewrite =
598- match Sys.getenv "REWRITE" with
599- | exception Not_found -> false
600- | _ -> true
601+let debug = Sys.getenv "DEBUG_COMBY" |> Option.is_some
602+
603+let rewrite = Sys.getenv "REWRITE" |> Option.is_some
604
605 let actual = Buffer.create 10
606
607diff --git a/lib/kernel/matchers/preprocess.ml b/lib/kernel/matchers/preprocess.ml
608index 84f3ed0..b6d10e7 100644
609--- a/lib/kernel/matchers/preprocess.ml
610+++ b/lib/kernel/matchers/preprocess.ml
611@@ -1,9 +1,6 @@
612 open Core_kernel
613
614-let debug =
615- match Sys.getenv "DEBUG_COMBY" with
616- | exception Not_found -> false
617- | _ -> true
618+let debug = Sys.getenv "DEBUG_COMBY" |> Option.is_some
619
620 let append_rule (module Parser : Types.Rule.S) rule parent_rule =
621 let open Option in
622diff --git a/lib/kernel/matchers/regexp.ml b/lib/kernel/matchers/regexp.ml
623index ef0bd59..906820b 100644
624--- a/lib/kernel/matchers/regexp.ml
625+++ b/lib/kernel/matchers/regexp.ml
626@@ -3,7 +3,7 @@ open Vangstrom
627 let debug =
628 match Sys.getenv "DEBUG_COMBY" with
629 | exception Not_found -> false
630- | _ -> true
631+ | (_ : string) -> true
632
633 module type Regexp_engine_intf = sig
634 type t
635diff --git a/lib/kernel/matchers/rewrite.ml b/lib/kernel/matchers/rewrite.ml
636index 32c4740..2fc28db 100644
637--- a/lib/kernel/matchers/rewrite.ml
638+++ b/lib/kernel/matchers/rewrite.ml
639@@ -4,10 +4,7 @@ open Core_kernel
640 open Match
641 open Replacement
642
643-let debug =
644- match Sys.getenv "DEBUG_COMBY" with
645- | exception Not_found -> false
646- | _ -> true
647+let debug = Sys.getenv "DEBUG_COMBY" |> Option.is_some
648
649 let counter =
650 let uuid_for_id_counter = ref 0 in
651diff --git a/lib/kernel/matchers/template.ml b/lib/kernel/matchers/template.ml
652index 423a07f..136236c 100644
653--- a/lib/kernel/matchers/template.ml
654+++ b/lib/kernel/matchers/template.ml
655@@ -4,10 +4,7 @@ open Core_kernel
656 open Match
657 open Types.Template
658
659-let debug =
660- match Sys.getenv "DEBUG_COMBY" with
661- | exception Not_found -> false
662- | _ -> true
663+let debug = Sys.getenv "DEBUG_COMBY" |> Option.is_some
664
665 module Make (Metasyntax : Types.Metasyntax.S) (External : Types.External.S) : Types.Template.S = struct
666
667diff --git a/lib/kernel/parsers/dune b/lib/kernel/parsers/dune
668index 28b020c..0cc1fa5 100644
669--- a/lib/kernel/parsers/dune
670+++ b/lib/kernel/parsers/dune
671@@ -1,6 +1,8 @@
672 (library
673- (name parsers)
674- (public_name comby-kernel.parsers)
675- (instrumentation (backend bisect_ppx))
676- (preprocess (pps ppx_sexp_conv))
677- (libraries core_kernel comby-kernel.vangstrom mparser))
678+ (name parsers)
679+ (public_name comby-kernel.parsers)
680+ (instrumentation
681+ (backend bisect_ppx))
682+ (preprocess
683+ (pps ppx_sexp_conv))
684+ (libraries core_kernel comby-kernel.vangstrom mparser))
685diff --git a/lib/kernel/replacement/dune b/lib/kernel/replacement/dune
686index 3e62de6..485b716 100644
687--- a/lib/kernel/replacement/dune
688+++ b/lib/kernel/replacement/dune
689@@ -1,6 +1,13 @@
690 (library
691- (name replacement)
692- (public_name comby-kernel.replacement)
693- (instrumentation (backend bisect_ppx))
694- (preprocess (pps ppx_deriving_yojson))
695- (libraries comby-kernel.match core_kernel yojson ppx_deriving_yojson ppx_deriving_yojson.runtime))
696+ (name replacement)
697+ (public_name comby-kernel.replacement)
698+ (instrumentation
699+ (backend bisect_ppx))
700+ (preprocess
701+ (pps ppx_deriving_yojson))
702+ (libraries
703+ comby-kernel.match
704+ core_kernel
705+ yojson
706+ ppx_deriving_yojson
707+ ppx_deriving_yojson.runtime))
708diff --git a/lib/semantic/dune b/lib/semantic/dune
709index 9a244d3..186a2ed 100644
710--- a/lib/semantic/dune
711+++ b/lib/semantic/dune
712@@ -1,11 +1,8 @@
713 (library
714- (name comby_semantic)
715- (public_name comby-semantic)
716- (instrumentation (backend bisect_ppx))
717- (preprocess (pps ppx_deriving.show ppx_deriving.eq ppx_sexp_conv))
718- (libraries
719- core_kernel
720- lwt
721- cohttp
722- cohttp-lwt-unix
723- yojson))
724+ (name comby_semantic)
725+ (public_name comby-semantic)
726+ (instrumentation
727+ (backend bisect_ppx))
728+ (preprocess
729+ (pps ppx_deriving.show ppx_deriving.eq ppx_sexp_conv))
730+ (libraries core_kernel lwt cohttp cohttp-lwt-unix yojson))
731diff --git a/lib/semantic/lsif.ml b/lib/semantic/lsif.ml
732index 49747bc..d6b3e19 100644
733--- a/lib/semantic/lsif.ml
734+++ b/lib/semantic/lsif.ml
735@@ -3,10 +3,7 @@ open Lwt
736 open Cohttp
737 open Cohttp_lwt_unix
738
739-let debug =
740- match Sys.getenv "DEBUG_COMBY" with
741- | exception Not_found -> false
742- | _ -> true
743+let debug = Sys.getenv "DEBUG_COMBY" |> Option.is_some
744
745 module Formatting = struct
746 type t =
747diff --git a/src/dune b/src/dune
748index 444a5a3..f006195 100644
749--- a/src/dune
750+++ b/src/dune
751@@ -1,10 +1,17 @@
752 (executables
753- (libraries comby core ppx_deriving_yojson ppx_deriving_yojson.runtime
754- (select if_hack_parallel.ml from
755- (hack_parallel -> if_hack_parallel.available.ml)
756- (!hack_parallel -> if_hack_parallel.unavailable.ml))
757- )
758- (preprocess (pps ppx_deriving_yojson ppx_let ppx_deriving.show ppx_sexp_conv))
759+ (libraries
760+ comby
761+ core
762+ core_unix.command_unix
763+ ppx_deriving_yojson
764+ ppx_deriving_yojson.runtime
765+ (select
766+ if_hack_parallel.ml
767+ from
768+ (hack_parallel -> if_hack_parallel.available.ml)
769+ (!hack_parallel -> if_hack_parallel.unavailable.ml)))
770+ (preprocess
771+ (pps ppx_deriving_yojson ppx_let ppx_deriving.show ppx_sexp_conv))
772 (modules main if_hack_parallel)
773 (modes byte exe)
774 (names main))
775@@ -20,4 +27,5 @@
776 (install
777 (package comby)
778 (section bin)
779- (files (main.exe as comby)))
780+ (files
781+ (main.exe as comby)))
782diff --git a/src/main.ml b/src/main.ml
783index 1def81d..79af76b 100644
784--- a/src/main.ml
785+++ b/src/main.ml
786@@ -1,4 +1,5 @@
787 open Core
788+module Unix = Core_unix
789 open Command.Let_syntax
790
791 open Comby_kernel
792@@ -47,7 +48,7 @@ let substitute_environment_only_and_exit metasyntax_path anonymous_arguments jso
793 match metasyntax_path with
794 | None -> Matchers.Metasyntax.default_metasyntax
795 | Some metasyntax_path ->
796- match Sys.file_exists metasyntax_path with
797+ match Sys_unix.file_exists metasyntax_path with
798 | `No | `Unknown ->
799 Format.eprintf "Could not open file: %s@." metasyntax_path;
800 exit 1
801@@ -95,7 +96,7 @@ let base_command_parameters : (unit -> 'result) Command.Param.t =
802 and verbose = flag "verbose" no_arg ~doc:(Format.sprintf "Log to %s" verbose_out_file)
803 and rule = flag "rule" (optional_with_default "where true" string) ~doc:"rule Apply rules to matches."
804 and match_timeout = flag "timeout" (optional_with_default 3 int) ~doc:"seconds Set match timeout on a source. Default: 3 seconds"
805- and target_directory = flag "directory" ~aliases:["d"] (optional_with_default (Sys.getcwd ()) string) ~doc:(Format.sprintf "path Run recursively on files in a directory relative to the root. Default is current directory: %s" @@ Sys.getcwd ())
806+ and target_directory = flag "directory" ~aliases:["d"] (optional_with_default (Sys_unix.getcwd ()) string) ~doc:(Format.sprintf "path Run recursively on files in a directory relative to the root. Default is current directory: %s" @@ Sys_unix.getcwd ())
807 and directory_depth = flag "depth" (optional int) ~doc:"n Depth to recursively descend into directories"
808 and templates = flag "templates" ~aliases:["config"; "configuration"] (optional (Arg_type.comma_separated string)) ~doc:"paths CSV of directories containing templates, or TOML configuration files"
809 and file_filters = flag "extensions" ~aliases:["e"; "file-extensions"; "f"] (optional (Arg_type.comma_separated string)) ~doc:"extensions Comma-separated extensions to include, like \".go\" or \".c,.h\". It is just a file suffix, so you can use it to filter file names like \"main.go\". The extension will be used to infer a matcher, unless -custom-matcher or -matcher is specified"
810@@ -147,7 +148,7 @@ let base_command_parameters : (unit -> 'result) Command.Param.t =
811 | l ->
812 List.map l ~f:(fun pattern ->
813 if String.contains pattern '/' then
814- match Filename.realpath pattern with
815+ match Filename_unix.realpath pattern with
816 | exception Unix.Unix_error _ ->
817 Format.eprintf
818 "No such file or directory: %s. Comby interprets \
819@@ -204,7 +205,7 @@ let base_command_parameters : (unit -> 'result) Command.Param.t =
820 let omega = omega || omega_env in
821 let fast_offset_conversion_env = Option.is_some @@ Sys.getenv "FAST_OFFSET_CONVERSION_COMBY" in
822 let fast_offset_conversion = fast_offset_conversion_env || fast_offset_conversion in
823- let arch = Unix.Utsname.machine (Core.Unix.uname ()) in
824+ let arch = Unix.Utsname.machine (Unix.uname ()) in
825 let compute_mode = match sequential, parany, arch with
826 | true, _, _ -> `Sequential
827 | _, true, _
828@@ -304,7 +305,7 @@ let parse_comby_dot_file () =
829
830 let () =
831 If_hack_parallel.check_entry_point ();
832- Command.run default_command ~version:"1.8.1" ~extend:(fun _ ->
833- match Sys.file_exists ".comby" with
834+ Command_unix.run default_command ~version:"1.8.1" ~extend:(fun _ ->
835+ match Sys_unix.file_exists ".comby" with
836 | `Yes -> parse_comby_dot_file ()
837 | _ -> [])
838diff --git a/test/alpha/dune b/test/alpha/dune
839index d7e5532..020677c 100644
840--- a/test/alpha/dune
841+++ b/test/alpha/dune
842@@ -1,17 +1,14 @@
843 (library
844 (name alpha_test_integration)
845 (package comby)
846- (modules
847- test_special_matcher_cases
848- test_substring_disabled)
849+ (modules test_special_matcher_cases test_substring_disabled)
850 (inline_tests)
851- (preprocess (pps ppx_expect ppx_sexp_message ppx_deriving_yojson))
852- (libraries
853- comby
854- cohttp-lwt-unix
855- core
856- camlzip))
857+ (preprocess
858+ (pps ppx_expect ppx_sexp_message ppx_deriving_yojson))
859+ (libraries comby cohttp-lwt-unix core camlzip))
860
861 (alias
862-(name runtest)
863-(deps (source_tree example) (source_tree example/src/.ignore-me)))
864+ (name runtest)
865+ (deps
866+ (source_tree example)
867+ (source_tree example/src/.ignore-me)))
868diff --git a/test/common/dune b/test/common/dune
869index 6851f2e..bc3c055 100644
870--- a/test/common/dune
871+++ b/test/common/dune
872@@ -36,16 +36,14 @@
873 test_regex_holes
874 test_template_constraints
875 test_custom_metasyntax
876- test_rewrite_attributes
877- )
878+ test_rewrite_attributes)
879 (inline_tests)
880- (preprocess (pps ppx_expect ppx_sexp_message ppx_deriving_yojson))
881- (libraries
882- comby
883- cohttp-lwt-unix
884- core
885- camlzip))
886+ (preprocess
887+ (pps ppx_expect ppx_sexp_message ppx_deriving_yojson))
888+ (libraries comby cohttp-lwt-unix core camlzip))
889
890 (alias
891-(name runtest)
892-(deps (source_tree example) (source_tree example/src/.ignore-me)))
893+ (name runtest)
894+ (deps
895+ (source_tree example)
896+ (source_tree example/src/.ignore-me)))
897diff --git a/test/common/test_cli.ml b/test/common/test_cli.ml
898index 3606367..d5d0c0b 100644
899--- a/test/common/test_cli.ml
900+++ b/test/common/test_cli.ml
901@@ -1,7 +1,10 @@
902 open Core
903 open Camlzip
904
905+module Filename = Filename_unix
906+module Sys = Sys_unix
907 module Time = Core_kernel.Time_ns.Span
908+module Unix = Core_unix
909
910 let binary_path = "../../../../comby"
911
912diff --git a/test/common/test_cli_helper.ml b/test/common/test_cli_helper.ml
913index 5791ee6..18372ae 100644
914--- a/test/common/test_cli_helper.ml
915+++ b/test/common/test_cli_helper.ml
916@@ -1,6 +1,7 @@
917 open Core
918
919 module Time = Core_kernel.Time_ns.Span
920+module Unix = Core_unix
921
922 let binary_path = "../../../../comby"
923
924diff --git a/test/omega/dune b/test/omega/dune
925index 3b31a7e..bf68dcb 100644
926--- a/test/omega/dune
927+++ b/test/omega/dune
928@@ -2,20 +2,19 @@
929 (name omega_test_integration)
930 (package comby)
931 (modules
932-;
933-; TODO
934-;
935+ ;
936+ ; TODO
937+ ;
938 test_optional_holes
939 test_special_matcher_cases
940 test_substring_disabled)
941 (inline_tests)
942- (preprocess (pps ppx_expect ppx_sexp_message ppx_deriving_yojson))
943- (libraries
944- comby
945- cohttp-lwt-unix
946- core
947- camlzip))
948+ (preprocess
949+ (pps ppx_expect ppx_sexp_message ppx_deriving_yojson))
950+ (libraries comby cohttp-lwt-unix core camlzip))
951
952 (alias
953-(name runtest)
954-(deps (source_tree example) (source_tree example/src/.ignore-me)))
955+ (name runtest)
956+ (deps
957+ (source_tree example)
958+ (source_tree example/src/.ignore-me)))