Open liyishuai opened 2 months ago
Hi @liyishuai , this should be pretty easy to add.
The problem is that the menhir
stanza doesn't recognize the --coq
flag, and in particular it doesn't know that a .v file will be producded.
In order to fix this, go to src/dune_rules/menhir/menhir_rules.ml
, and add next to both calls of
let* explain_flags = explain_flags base stanza in
a Coq version coq_flags
that will detect if the --coq
flag has passed, then add to the target list the .v
file generated.
I'd be happy to do a seed PR, but I'd like help to write the test case(s).
I have an active repo https://github.com/liyishuai/coq-json that can serve as the test case (feel free to move everything under theories/
).
Thanks @liyishuai , unfortunately that repos is too heavy for Dune's CI.
In order to add a test case to Dune, we should do something self-contained (that can work with coq-stdlib).
Official example, currently Makefile-based: https://github.com/LexiFi/menhir/tree/master/demos/coq-minicalc
Desired Behavior
Allow generating
Parser.v
fromParser.vy
, and using it in the(coq.theory)
stanza.Example
Currently: