Skip to content

Commit 06ca955

Browse files
authored
Merge pull request #312 from gpetiot/rm-rule
Remove deprecated 'rule' command
2 parents 1e69e26 + 58f15a6 commit 06ca955

File tree

21 files changed

+10
-497
lines changed

21 files changed

+10
-497
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- Dropped compatibility with older OCaml versions. The minimal supported range
1818
is 4.08 to 4.13 now (#345, @Leonidas-from-XIV)
1919
- Do not install deprecated `mdx` binary anymore (#274, @gpetiot)
20+
- Remove deprecated `rule` command (#312, @gpetiot)
2021

2122
#### Security
2223

bin/main.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
open Cmdliner
1818

19-
let cmds = [ Test.cmd; Pp.cmd; Rule.cmd; Deps.cmd; Dune_gen.cmd ]
19+
let cmds = [ Test.cmd; Pp.cmd; Deps.cmd; Dune_gen.cmd ]
2020

2121
let main (`Setup ()) = `Help (`Pager, None)
2222

bin/rule.ml

Lines changed: 0 additions & 278 deletions
This file was deleted.

bin/rule.mli

Lines changed: 0 additions & 19 deletions
This file was deleted.

lib/block.ml

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ type t = {
7676
loc : Location.t;
7777
section : section option;
7878
dir : string option;
79-
source_trees : string list;
80-
required_packages : string list;
8179
labels : Label.t list;
8280
legacy_labels : bool;
8381
contents : string list;
@@ -200,8 +198,6 @@ let directory t = t.dir
200198

201199
let file t = match t.value with Include t -> Some t.file_included | _ -> None
202200

203-
let source_trees t = t.source_trees
204-
205201
let non_det t =
206202
match t.value with
207203
| OCaml b -> b.non_det
@@ -215,32 +211,6 @@ let set_variables t = t.set_variables
215211

216212
let unset_variables t = t.unset_variables
217213

218-
let explicit_required_packages t = t.required_packages
219-
220-
let require_re =
221-
let open Re in
222-
seq [ str "#require \""; group (rep1 any); str "\"" ]
223-
224-
let require_from_line line =
225-
let open Util.Result.Infix in
226-
let re = Re.compile require_re in
227-
match Re.exec_opt re line with
228-
| None -> Ok Library.Set.empty
229-
| Some group ->
230-
let matched = Re.Group.get group 1 in
231-
let libs_str = String.split_on_char ',' matched in
232-
Util.Result.List.map ~f:Library.from_string libs_str >>| fun libs ->
233-
Library.Set.of_list libs
234-
235-
let require_from_lines lines =
236-
let open Util.Result.Infix in
237-
Util.Result.List.map ~f:require_from_line lines >>| fun libs ->
238-
List.fold_left Library.Set.union Library.Set.empty libs
239-
240-
let required_libraries = function
241-
| { value = Toplevel _; contents; _ } -> require_from_lines contents
242-
| _ -> Ok Library.Set.empty
243-
244214
let value t = t.value
245215

246216
let section t = t.section
@@ -320,8 +290,6 @@ type block_config = {
320290
dir : string option;
321291
skip : bool;
322292
version : (Label.Relation.t * Ocaml_version.t) option;
323-
source_trees : string list;
324-
required_packages : string list;
325293
set_variables : (string * string) list;
326294
unset_variables : string list;
327295
file_inc : string option;
@@ -341,12 +309,6 @@ let get_block_config l =
341309
dir = get_label (function Dir x -> Some x | _ -> None) l;
342310
skip = List.exists (function Label.Skip -> true | _ -> false) l;
343311
version = get_label (function Version (x, y) -> Some (x, y) | _ -> None) l;
344-
source_trees =
345-
List.filter_map (function Label.Source_tree x -> Some x | _ -> None) l;
346-
required_packages =
347-
List.filter_map
348-
(function Label.Require_package x -> Some x | _ -> None)
349-
l;
350312
set_variables =
351313
List.filter_map (function Label.Set (v, x) -> Some (v, x) | _ -> None) l;
352314
unset_variables =
@@ -449,8 +411,6 @@ let mk ~loc ~section ~labels ~legacy_labels ~header ~contents ~errors =
449411
loc;
450412
section;
451413
dir = config.dir;
452-
source_trees = config.source_trees;
453-
required_packages = config.required_packages;
454414
labels;
455415
legacy_labels;
456416
contents;

0 commit comments

Comments
 (0)