Skip to content

Commit

Permalink
[coq] Rename (coqlib ...) to (coq.theory ...)
Browse files Browse the repository at this point in the history
Support for the first form will be dropped in the 1.0 version of the
Coq language.

Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
  • Loading branch information
ejgallego committed Apr 12, 2019
1 parent 546e712 commit d08702b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
unreleased
----------

- [coq] Rename `(coqlib ...)` to `(coq.theory ...)`, support for
`coqlib` will be dropped in the 1.0 version of the Coq language
(#2055, @ejgallego)

- [coq] Add `coq.pp` stanza to help with pre-processing of grammar
files (#2054, @ejgallego, review by @rgrinberg)

Expand Down
6 changes: 3 additions & 3 deletions doc/coq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ in the ``dune-project`` file. For example:
(using coq 0.1)
This will enable support for the ``coqlib`` stanza in the current project. If the
This will enable support for the ``coq.theory`` stanza in the current project. If the
language version is absent, dune will automatically add this line with the
latest Coq version to the project file once a ``(coqlib ...)`` stanza is used anywhere.
latest Coq version to the project file once a ``(coq.theory ...)`` stanza is used anywhere.


Basic Usage
Expand All @@ -26,7 +26,7 @@ The basic form for defining Coq libraries is very similar to the OCaml form:

.. code:: scheme
(coqlib
(coq.theory
(name <module_prefix>)
(public_name <package.lib_name>)
(synopsis <text>)
Expand Down
9 changes: 7 additions & 2 deletions src/dune_file.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1886,11 +1886,16 @@ module Coq = struct

let unit_to_sexp () = Sexp.List []

let coqlib_p = "coqlib", decode >>| fun x -> [T x]
let coqlib_warn x =
Errors.warn x.loc "(coqlib ...) is deprecated, please use (coq.theory ...) instead";
x

let coqlib_p = "coqlib", decode >>| fun x -> [T (coqlib_warn x)]
let coqtheory_p = "coq.theory", decode >>| fun x -> [T x]
let coqpp_p = "coq.pp", Coqpp.(decode >>| fun x -> [T x])

let unit_stanzas =
let+ r = return [coqlib_p; coqpp_p] in
let+ r = return [coqlib_p; coqtheory_p; coqpp_p] in
((), r)

let key =
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/coq/base/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(coqlib
(coq.theory
(name basic)
(public_name base.basic)
(modules :standard)
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/coq/ml_lib/theories/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(coqlib
(coq.theory
(name Plugin)
(public_name ml_lib.Plugin)
(synopsis "Test Plugin")
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/coq/rec_module/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(coqlib
(coq.theory
(name rec_module)
(public_name rec.module)
(modules :standard)
Expand Down

0 comments on commit d08702b

Please sign in to comment.