-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9280 from Alizter/ps/branch/feature_coq___coqdoc_…
…flags_in_env_stanza feature(coq): coqdoc_flags in env stanza
- Loading branch information
Showing
16 changed files
with
174 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- Add `coqdoc_flags` field to `coq` field of `env` stanza allowing the setting of | ||
workspace-wide defaults for `coqdoc_flags`. (#9280, fixes #9139, @Alizter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
open Import | ||
open Dune_lang.Decoder | ||
|
||
type t = | ||
{ flags : Ordered_set_lang.Unexpanded.t | ||
; coqdoc_flags : Ordered_set_lang.Unexpanded.t | ||
} | ||
|
||
let default = | ||
{ flags = Ordered_set_lang.Unexpanded.standard | ||
; coqdoc_flags = Ordered_set_lang.Unexpanded.standard | ||
} | ||
;; | ||
|
||
let flags t = t.flags | ||
let coqdoc_flags t = t.coqdoc_flags | ||
|
||
let decode = | ||
field | ||
"coq" | ||
~default | ||
(fields | ||
(let+ flags = | ||
Ordered_set_lang.Unexpanded.field | ||
"flags" | ||
~check:(Dune_lang.Syntax.since Stanza.syntax (2, 7)) | ||
and+ coqdoc_flags = | ||
Ordered_set_lang.Unexpanded.field | ||
"coqdoc_flags" | ||
~check:(Dune_lang.Syntax.since Stanza.syntax (3, 13)) | ||
in | ||
{ flags; coqdoc_flags })) | ||
;; | ||
|
||
let equal { flags; coqdoc_flags } t = | ||
Ordered_set_lang.Unexpanded.equal flags t.flags | ||
&& Ordered_set_lang.Unexpanded.equal coqdoc_flags t.coqdoc_flags | ||
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
open Import | ||
|
||
(** Environment for Coq. *) | ||
type t | ||
|
||
val equal : t -> t -> bool | ||
|
||
(** Default environment for Coq. *) | ||
val default : t | ||
|
||
(** Flags for Coq binaries. *) | ||
val flags : t -> Ordered_set_lang.Unexpanded.t | ||
|
||
(** Flags for coqdoc *) | ||
val coqdoc_flags : t -> Ordered_set_lang.Unexpanded.t | ||
|
||
(** Parser for env stanza. *) | ||
val decode : t Dune_lang.Decoder.fields_parser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
open Import | ||
|
||
type t = | ||
{ coq_flags : string list | ||
; coqdoc_flags : string list | ||
} | ||
|
||
let default = { coq_flags = [ "-q" ]; coqdoc_flags = [ "--toc" ] } | ||
|
||
let dump { coq_flags; coqdoc_flags } = | ||
List.map | ||
~f:Dune_lang.Encoder.(pair string (list string)) | ||
[ "coq_flags", coq_flags; "coqdoc_flags", coqdoc_flags ] | ||
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
type t = | ||
{ coq_flags : string list | ||
; coqdoc_flags : string list | ||
} | ||
|
||
val default : t | ||
val dump : t -> Dune_lang.t list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Testing the coqdoc flags field of the env stanza. | ||
|
||
$ cat > dune-project <<EOF | ||
> (lang dune 3.13) | ||
> (using coq 0.8) | ||
> EOF | ||
|
||
$ cat > dune <<EOF | ||
> (env | ||
> (_ | ||
> (coq | ||
> (coqdoc_flags :standard -toc-depth 2)))) | ||
> (coq.theory | ||
> (name a)) | ||
> EOF | ||
|
||
$ dune build @doc | ||
|
||
$ tail _build/log -n 1 | ./scrub_coq_args.sh | sed 's/.*coq/coq/' | ||
coqdoc | ||
coq/theories Coq | ||
-R . a --toc -toc-depth 2 --html -d | ||
a.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters