From: "Nathaniel J. Gaylinn" <ngaylinn@cs.brown.edu>
To: Hendrik Tews <tews@tcs.inf.tu-dresden.de>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] OCaml IDE (Camlp4 for code formatting)
Date: Tue, 21 Jun 2005 09:47:35 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.58.0506210942400.14091@point> (raw)
In-Reply-To: <rld5qggfsc.fsf@ithif59.inf.tu-dresden.de>
On Tue, 21 Jun 2005, Hendrik Tews wrote:
> I understand why it makes this change,
>
> Could you explain? (Because I don't understand. "let _ = 5" and
> "5" are different internally.)
Heh, I didn't realize that they were handled different internally ;) I
thought it was a reasonable thing to do because it is more explicit and
equivalent, but if it isn't actually equivalent...
>
> On a similar note, is there any reference to the format in which Camlp4
> outputs its syntax tree?
>
> I don't think so. It is defined in the compiler sources and
> probably not for the general public. However, you can define your
> own camlp4 printers: Write a module that overwrites
> Pcaml.print_implem and load this module into camlp4. The function
> that you plug into Pcaml.print_implem has to pattern match on
> camlp4's ast, which is defined in mLast.mli. You can use the
> constructors from mLast.mli or the quotations from q_MLast. See
> the source of pr_o or other pretty printers (like in my ocamlp4
> package).
Would it be difficult to write a printer that had much direct access with
the original file? That's something that I'd quite obviously need.
In any way, I think I'm going to try to do more research into how Tuareg
does its indentation. It's unfortunately not well documented, but it has
the added benefit of being able to indent one line at a time. I'll take a
look into writing a new printer, but I suspect that that will be the
harder route... correct me if I'm wrong!
-- Nate
next prev parent reply other threads:[~2005-06-21 13:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-20 20:08 Nathaniel J. Gaylinn
2005-06-21 10:33 ` [Caml-list] " Hendrik Tews
2005-06-21 13:47 ` Nathaniel J. Gaylinn [this message]
2005-06-21 15:18 ` Hendrik Tews
2005-06-21 18:11 ` David Brown
2005-06-29 14:54 ` [Caml-list] Keyboard interrupt in Windows Nathaniel J. Gaylinn
2005-06-29 16:13 ` Christopher A. Watford
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=Pine.LNX.4.58.0506210942400.14091@point \
--to=ngaylinn@cs.brown.edu \
--cc=caml-list@yquem.inria.fr \
--cc=tews@tcs.inf.tu-dresden.de \
/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