English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Generating comments from camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-09-11 (14:00)
From: Alexey Rodriguez <mrchebas@g...>
Subject: Generating comments from camlp4
Dear list,

Is there a way to generate comments from camlp4 code?

We have preprocessors that generate the following kind of code in signatures:

>  <:sig_item<
>    $sig_generator the_type_declaration$;
>  >>

However, these extra function signatures show up in the output of
ocamldoc which is very annoying. We thought of using "ocamldoc stop"
tags (** / **), but we do not know how to generate such comments from
camlp4. Do you know of a way to do this:

>  <:sig_item<
>    (** / **)
>    $sig_generator the_type_declaration$;
>    (** / **)
>  >>

Comments are not part of the AST so I suppose we have to do some
hacking at the lexing level.

Note that having a dummy preprocessor that generates empty signatures
is not an option: this causes type checking errors that require a lot
of effort to circumvent.