From: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] How to Create Sensible Debugging Information when Dynamically Typechecking Code Generated with camlp5 Quotations
Date: Mon, 17 Dec 2007 13:41:17 +0100 [thread overview]
Message-ID: <20071217124117.GA24752@yquem.inria.fr> (raw)
In-Reply-To: <518979.92669.qm@web60112.mail.yahoo.com>
Hi,
On Mon, Dec 17, 2007 at 01:11:09AM -0800, echinuz echinuz wrote:
> This contains no location information since Plot.Exc is not caught
> and handled in the same manner as it is during preprocessing. I
> would like an error similar to the first case, when there were no
> quotations, to be shown in the second case, when there are
> quotations.
Ok, I understand your problem. It is indeed something missing in Camlp5.
I just added what is necessary and made a release. Download the latest
version (5.05) of Camlp5 at:
http://pauillac.inria.fr/~ddr/camlp5/
I added a function "Pcaml.quotation_location" which returns the location
of the quotation text, relative to the source file, and usable in quotations
expanders.
Your code:
let get_loc l=
string_of_int (Ploc.line_nb l),
string_of_int (Ploc.bol_pos l),
string_of_int (Ploc.first_pos l),
string_of_int (Ploc.last_pos l)
could be changed into:
let get_loc l=
let l =
let qloc = Pcaml.quotation_location () in
Ploc.shift (Ploc.first_pos qloc) l
in
string_of_int (Ploc.line_nb l),
string_of_int (Ploc.bol_pos l),
string_of_int (Ploc.first_pos l),
string_of_int (Ploc.last_pos l)
Hope this helps.
--
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/
next prev parent reply other threads:[~2007-12-17 12:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-14 21:22 echinuz echinuz
2007-12-15 15:47 ` [Caml-list] " Nicolas Pouillard
2007-12-15 19:32 ` echinuz echinuz
2007-12-16 16:50 ` Daniel de Rauglaudre
2007-12-17 10:54 ` Nicolas Pouillard
2007-12-17 3:29 ` echinuz echinuz
2007-12-17 5:28 ` Daniel de Rauglaudre
2007-12-17 9:11 ` echinuz echinuz
2007-12-17 12:41 ` Daniel de Rauglaudre [this message]
2007-12-18 23:05 ` echinuz echinuz
2007-12-19 9:50 ` Daniel de Rauglaudre
2007-12-15 16:54 ` Daniel de Rauglaudre
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=20071217124117.GA24752@yquem.inria.fr \
--to=daniel.de_rauglaudre@inria.fr \
--cc=caml-list@inria.fr \
/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