summaryrefslogtreecommitdiff
path: root/ocamldoc/odoc_analyse.ml
diff options
context:
space:
mode:
authorRichard Eisenberg <reisenberg@janestreet.com>2023-02-12 17:14:12 -0500
committerGitHub <noreply@github.com>2023-02-12 23:14:12 +0100
commit8a61778d2716304203974d20ead1b2736c1694a8 (patch)
treeb57009c340b7ffa0a52390780feb205d200018ef /ocamldoc/odoc_analyse.ml
parent61f10168da60e94a5f9c2d1ce4cc4e4d512d0007 (diff)
downloadocaml-8a61778d2716304203974d20ead1b2736c1694a8.tar.gz
Add syntax for generative functor application (#11984)
Previously, writing [F ()] was the same as writing [F (struct end)], even though the latter looks like the use of an applicative functor, not a generative one. This commit, originally written by Frédéric Bour <fred@tarides.com>, adds new syntax to our AST to represent generative functor application and propagates this change throughout the compiler. In addition, it adds a new warning, 73, to report when a user has written [F (struct end)] but should now update to [F ()]. Co-authored-by: Frédéric Bour <fred@tarides.com>
Diffstat (limited to 'ocamldoc/odoc_analyse.ml')
-rw-r--r--ocamldoc/odoc_analyse.ml8
1 files changed, 6 insertions, 2 deletions
diff --git a/ocamldoc/odoc_analyse.ml b/ocamldoc/odoc_analyse.ml
index 257e2cbc86..459c1c8eeb 100644
--- a/ocamldoc/odoc_analyse.ml
+++ b/ocamldoc/odoc_analyse.ml
@@ -355,8 +355,12 @@ and remove_module_elements_between_stop_in_module_kind k =
| Odoc_module.Module_functor (params, k2) ->
Odoc_module.Module_functor (params, remove_module_elements_between_stop_in_module_kind k2)
| Odoc_module.Module_apply (k1, k2) ->
- Odoc_module.Module_apply (remove_module_elements_between_stop_in_module_kind k1,
- remove_module_elements_between_stop_in_module_kind k2)
+ Odoc_module.Module_apply
+ (remove_module_elements_between_stop_in_module_kind k1,
+ remove_module_elements_between_stop_in_module_kind k2)
+ | Odoc_module.Module_apply_unit k1 ->
+ Odoc_module.Module_apply_unit
+ (remove_module_elements_between_stop_in_module_kind k1)
| Odoc_module.Module_with (mtkind, s) ->
Odoc_module.Module_with (remove_module_elements_between_stop_in_module_type_kind mtkind, s)
| Odoc_module.Module_constraint (k2, mtkind) ->