Skip to content

Commit

Permalink
Merge pull request #2055 from ejgallego/coq+rename
Browse files Browse the repository at this point in the history
[coq] Rename `(coqlib ...)` to `(coq.theory ...)`
  • Loading branch information
ejgallego authored Apr 12, 2019
2 parents 546e712 + 5077132 commit 1b65a3d
Show file tree
Hide file tree
Showing 6 changed files with 19 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
11 changes: 9 additions & 2 deletions src/dune_file.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1886,11 +1886,18 @@ 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 and will be removed in the Coq \
language version 1.0, 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 1b65a3d

Please sign in to comment.