-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce (menhir) field in (env) stanza
Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
- Loading branch information
Showing
17 changed files
with
241 additions
and
88 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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
- Menhir: generate `.conflicts` file by default. Add new field to the `(menhir)` | ||
stanza to control the generation of this file: `(explain <blang expression>)`. | ||
Introduce `(menhir (flags ...) (explain ...))` field in the `(env)` stanza, | ||
delete `(menhir_flags)` field. All changes are guarded under a new version of | ||
the Menhir extension, 2.2. | ||
(#9512, @nojb) |
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
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,34 @@ | ||
open Import | ||
|
||
type 'a t = | ||
{ flags : 'a | ||
; explain : Blang.t option | ||
} | ||
|
||
let map ~f t = { t with flags = f t.flags } | ||
|
||
let equal { flags; explain } t = | ||
Ordered_set_lang.Unexpanded.equal flags t.flags | ||
&& Option.equal Blang.equal explain t.explain | ||
;; | ||
|
||
let decode = | ||
let open Dune_lang.Decoder in | ||
fields | ||
@@ let+ flags = Ordered_set_lang.Unexpanded.field "flags" | ||
and+ explain = field_o "explain" Blang.decode in | ||
{ flags; explain } | ||
;; | ||
|
||
let empty = { flags = Ordered_set_lang.Unexpanded.standard; explain = None } | ||
let default = { flags = []; explain = None } | ||
|
||
let dump t = | ||
let open Action_builder.O in | ||
let+ flags = t.flags in | ||
List.map | ||
~f:Dune_lang.Encoder.(pair string Fun.id) | ||
[ "menhir_flags", Dune_lang.Encoder.(list string) flags | ||
; "menhir_explain", Dune_lang.Encoder.option Blang.encode t.explain | ||
] | ||
;; |
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,13 @@ | ||
open Import | ||
|
||
type 'a t = | ||
{ flags : 'a | ||
; explain : Blang.t option | ||
} | ||
|
||
val map : f:('a -> 'b) -> 'a t -> 'b t | ||
val equal : Ordered_set_lang.Unexpanded.t t -> Ordered_set_lang.Unexpanded.t t -> bool | ||
val decode : Ordered_set_lang.Unexpanded.t t Dune_lang.Decoder.t | ||
val empty : Ordered_set_lang.Unexpanded.t t | ||
val default : string list t | ||
val dump : string list Action_builder.t t -> Dune_lang.t list Action_builder.t |
Oops, something went wrong.