caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jake Donham <jake@donham.org>
To: Anil Madhavapeddy <anil@recoil.org>
Cc: Alexey Rodriguez <mrchebas@gmail.com>, OCaml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Re: Generating comments from camlp4
Date: Tue, 15 Sep 2009 18:03:38 -0700	[thread overview]
Message-ID: <c7e4e9f0909151803s7ed5575vab309b8780655ca4@mail.gmail.com> (raw)
In-Reply-To: <00A0564F-D9E3-4FFE-B8A6-E8F4FA5A11FC@recoil.org>

On Tue, Sep 15, 2009 at 5:42 AM, Anil Madhavapeddy <anil@recoil.org> wrote:
> I dont believe you can add comments with camlp4; I'm using type-conv to hack
> on an ORM layer, and it would be lovely to have the generated functions also
> have comments to not dirty up the OCamldoc.  And also, to maintain sanity
> when reading through pages of generated OCaml...

Comments are not passed through the AST, but somehow they make it from
the input file to the output file. It looks like in
Camlp4/Printers/OCaml.ml there is a hook into the tokenizer to keep
track of comments as they are tokenized (search for CommentFilter).
Maybe there is some way to inject comments (at particular locations)?
Possibly by calling Gram.lex_string and/or Gram.filter? A hack, no
doubt.

Jake


  reply	other threads:[~2009-09-16  1:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 13:59 Alexey Rodriguez
2009-09-15 12:26 ` Alexey Rodriguez
2009-09-15 12:42   ` [Caml-list] " Anil Madhavapeddy
2009-09-16  1:03     ` Jake Donham [this message]
2009-09-16  7:48       ` Alexey Rodriguez
2009-09-16  8:02         ` Tiphaine Turpin
2009-09-15 12:44   ` Tiphaine Turpin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c7e4e9f0909151803s7ed5575vab309b8780655ca4@mail.gmail.com \
    --to=jake@donham.org \
    --cc=anil@recoil.org \
    --cc=caml-list@inria.fr \
    --cc=mrchebas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).