Open Ninjapouet opened 1 year ago
In another project, I found:
dune-trailer = """(menhir (modules preproc_tokens grammar_common preproc_grammar)
(merge_into preproc_grammar)
(flags --table --external-tokens Preproc_tokens))
(menhir (modules preproc_tokens)
(flags --only-tokens))
"""
and worse:
(menhir (modules grammar_tokens grammar_common grammar)
(merge_into grammar)
(flags --inspection --cmly --table
--external-tokens Grammar_tokens
--unused-tokens))
(menhir (modules grammar_tokens)
(flags --inspection --table --only-tokens))
(rule
(targets text_keywords.ml)
(enabled_if (<> %{profile} "release"))
(deps grammar.cmly)
(mode promote)
(action
(with-stdout-to %{targets}
(run %{exe:./keywords/gen_keywords.exe} %{deps}
--external-tokens Grammar_tokens))))
(rule
(targets grammar_recover.ml)
(enabled_if (<> %{profile} "release"))
(deps grammar.cmly)
(mode promote)
(action
(with-stdout-to %{targets}
(run %{exe:./recover/gen_recover.exe} %{deps}))))
(rule
(targets grammar_contexts.ml)
(enabled_if (<> %{profile} "release"))
(deps grammar.cmly)
(mode promote)
(action
(with-stdout-to %{targets}
(run %{exe:./context/gen_contexts.exe} %{deps}
--external-tokens Grammar_tokens))))
(rule
(targets grammar_context.ml)
(enabled_if (<> %{profile} "release"))
(deps grammar.cmly)
(mode promote)
(action
(with-stdout-to %{targets}
(run %{exe:./context/gen_context.exe} %{deps}))))
(rule
(targets grammar_printer.ml)
(enabled_if (<> %{profile} "release"))
(deps grammar.cmly)
(mode promote)
(action
(with-stdout-to %{targets}
(run %{exe:./printer/gen_printer.exe} %{deps}))))
Ok, the last rules are probably not really related to menhir
itself, but use merlin
stuff built for it...
Following the PR https://github.com/OCamlPro/drom/pull/197, I suppose it would be nice to have a proper support to
menhir
as OCaml is often used DSL developments. I may suggest adding topackage.toml
something likewhich would toggle the
(use menhir "X.Y")
indune-project
and generate the(menhir ...)
stanzas according to the PR recommandations.