Skip to content

Commit 0cab18a

Browse files
committed
Remove Block.required_packages
1 parent 99dd92b commit 0cab18a

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

lib/block.ml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ type t = {
7676
loc : Location.t;
7777
section : section option;
7878
dir : string option;
79-
required_packages : string list;
8079
labels : Label.t list;
8180
legacy_labels : bool;
8281
contents : string list;
@@ -212,8 +211,6 @@ let set_variables t = t.set_variables
212211

213212
let unset_variables t = t.unset_variables
214213

215-
let explicit_required_packages t = t.required_packages
216-
217214
let require_re =
218215
let open Re in
219216
seq [ str "#require \""; group (rep1 any); str "\"" ]
@@ -234,10 +231,6 @@ let require_from_lines lines =
234231
Util.Result.List.map ~f:require_from_line lines >>| fun libs ->
235232
List.fold_left Library.Set.union Library.Set.empty libs
236233

237-
let required_libraries = function
238-
| { value = Toplevel _; contents; _ } -> require_from_lines contents
239-
| _ -> Ok Library.Set.empty
240-
241234
let value t = t.value
242235

243236
let section t = t.section
@@ -317,7 +310,6 @@ type block_config = {
317310
dir : string option;
318311
skip : bool;
319312
version : (Label.Relation.t * Ocaml_version.t) option;
320-
required_packages : string list;
321313
set_variables : (string * string) list;
322314
unset_variables : string list;
323315
file_inc : string option;
@@ -337,10 +329,6 @@ let get_block_config l =
337329
dir = get_label (function Dir x -> Some x | _ -> None) l;
338330
skip = List.exists (function Label.Skip -> true | _ -> false) l;
339331
version = get_label (function Version (x, y) -> Some (x, y) | _ -> None) l;
340-
required_packages =
341-
List.filter_map
342-
(function Label.Require_package x -> Some x | _ -> None)
343-
l;
344332
set_variables =
345333
List.filter_map (function Label.Set (v, x) -> Some (v, x) | _ -> None) l;
346334
unset_variables =
@@ -443,7 +431,6 @@ let mk ~loc ~section ~labels ~legacy_labels ~header ~contents ~errors =
443431
loc;
444432
section;
445433
dir = config.dir;
446-
required_packages = config.required_packages;
447434
labels;
448435
legacy_labels;
449436
contents;

lib/block.mli

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ type t = {
7878
loc : Location.t;
7979
section : section option;
8080
dir : string option;
81-
required_packages : string list;
8281
labels : Label.t list;
8382
legacy_labels : bool;
8483
contents : string list;
@@ -147,15 +146,6 @@ val set_variables : t -> (string * string) list
147146
val unset_variables : t -> string list
148147
(** [unset_variable t] is the list of environment variable to unset *)
149148

150-
val explicit_required_packages : t -> string list
151-
(** [explicit_required_packages t] returns the list of packages explicitly required by the user
152-
through require-package labels in the block [t]. *)
153-
154-
val required_libraries : t -> (Library.Set.t, string) Result.result
155-
(** [required_libraries t] returns the set of libaries that are loaded through [#require]
156-
statements in the block [t]. Always returns an empty set if [t] isn't a toplevel
157-
block. *)
158-
159149
val skip : t -> bool
160150
(** [skip t] is true iff [skip] is in the labels of [t]. *)
161151

0 commit comments

Comments
 (0)