Add (module_extensions ...) field to dune-project file#2373
Add (module_extensions ...) field to dune-project file#2373nojb wants to merge 2 commits intoocaml:masterfrom
Conversation
Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
|
The feature looks fine but I'm wondering if this should be an |
A per-project granularity is enough for my use-case; but if you think the extra generality is worth it, I can try to make it into an |
|
Okay, then let's not bother. However, the fact that the plumbing for for |
|
For symmetry I would also like to support Reason; I thought of the following syntax, which would express the default setting of What do you think? Also, do we want |
|
I have been wondering about providing first class support for defining derived languages such as reason. For instance, reason support could be defined as follow (though we'd keep it a builtin): (define_derived_language
(name reason)
(file
(kind impl)
(extension re)
(convert (run refmt --print binary %{input-file}))
(format (run refmt %{input-file})))
(file
(kind intf)
(extension rei)
(convert (run refmt --print binary %{input-file}))
(format (run refmt %{input-file}))))
That would cover this PR as well as anyone who would want to implement their own dialect of OCaml. |
|
This will be fixed in a more general way by #2404 |
This PR adds a new field
(module_extensions (intf ...) (impl ...))todune-projectthat allows to specify additional extensions to be used for implementations and interfaces in addition to.mland.mli.The motivation is that we are porting a large code base to use
dunethat for historical reasons uses a different extension than the standard ones. This is a minimal addition that makes it possible forduneto handle this, and it may come in handy in other situations as well.For simplicity, the current patch only allows to extend the set of extensions used with OCaml, Reason support could be added as well.