Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Toploop.add_directive #4834

Merged
merged 1 commit into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ Unreleased
new `(subst <disable|enable>)` stanza to the `dune-project` file.
(#4864, @kit-ty-kate)

- No longer reference deprecated Toploop functions when using dune files in
OCaml syntax. (#4834, fixes #4830, @nojb)

2.9.1 (07/09/2021)
------------------

Expand Down
15 changes: 9 additions & 6 deletions plugin/jbuild_plugin.ml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
let () =
Hashtbl.add Toploop.directive_table "require"
(Toploop.Directive_string ignore);
Hashtbl.add Toploop.directive_table "use"
(Toploop.Directive_string
let open Toploop in
let add_directive name desc =
add_directive name desc { section = ""; doc = "" }
in
add_directive "require" (Directive_string ignore);
add_directive "use"
(Directive_string
(fun _ ->
failwith "#use is not allowed inside a dune file in OCaml syntax"));
Hashtbl.add Toploop.directive_table "use_mod"
(Toploop.Directive_string
add_directive "use_mod"
(Directive_string
(fun _ ->
failwith "#use is not allowed inside a dune file in OCaml syntax"))

Expand Down
17 changes: 10 additions & 7 deletions src/dune_rules/assets.ml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
let jbuild_plugin_ml = {jbp|
let () =
Hashtbl.add Toploop.directive_table "require"
(Toploop.Directive_string ignore);
Hashtbl.add Toploop.directive_table "use"
(Toploop.Directive_string
let open Toploop in
let add_directive name desc =
add_directive name desc { section = ""; doc = "" }
in
add_directive "require" (Directive_string ignore);
add_directive "use"
(Directive_string
(fun _ ->
failwith "#use is not allowed inside a dune file in OCaml syntax"));
Hashtbl.add Toploop.directive_table "use_mod"
(Toploop.Directive_string
add_directive "use_mod"
(Directive_string
(fun _ ->
failwith "#use is not allowed inside a dune file in OCaml syntax"))

Expand Down Expand Up @@ -73,4 +76,4 @@ module V1 : sig
(** Execute a command and read its output *)
val run_and_read_lines : string -> string list
end
|jbp}
|jbp}