caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] menhir should reference source file and not generated source file
@ 2017-05-02 17:09 Helmut Brandl
  2017-05-02 19:49 ` François Pottier
  2017-05-09 19:32 ` François Pottier
  0 siblings, 2 replies; 5+ messages in thread
From: Helmut Brandl @ 2017-05-02 17:09 UTC (permalink / raw)
  To: caml users

Hello list,

I have switched from ocamlyacc to menhir. Basically the experience is very positive. However I continue to have the problem that any assertion failure reported by the runtime system always references the source file of the generated parser (i.e. the .ml file) and not the source file (i.e. the .mly file).

Is there any way to ask menhir to use the line numbers of the source file instead of the generated source?

Thanks for any hint.

Regards
Helmut

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] menhir should reference source file and not generated source file
  2017-05-02 17:09 [Caml-list] menhir should reference source file and not generated source file Helmut Brandl
@ 2017-05-02 19:49 ` François Pottier
  2017-05-03  1:18   ` Helmut Brandl
  2017-05-09 19:32 ` François Pottier
  1 sibling, 1 reply; 5+ messages in thread
From: François Pottier @ 2017-05-02 19:49 UTC (permalink / raw)
  To: caml-list


Hello,

Le 02/05/2017 19:09, Helmut Brandl a écrit :
> I continue to have the problem that any assertion failure reported by the
> runtime system always references the source file of the generated parser
> (i.e. the .ml file) and not the source file (i.e. the .mly file). Is there
> any way to ask menhir to use the line numbers of the source file instead of
> the generated source?

That's a good question, which I don't think anyone has asked before.

Looking into this issue, it turns out that if "menhir" is used, then the
generated .ml file does contain appropriate line number information (such
as # 4 "sample.mly"), whereas if "menhir --infer" is used, then this
information is omitted. The difference is observable if Assertion_failure
is raised. This is definitely a bug, which I will look into.
Thanks for reporting this!

--
François Pottier
francois.pottier@inria.fr
http://gallium.inria.fr/~fpottier/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] menhir should reference source file and not generated source file
  2017-05-02 19:49 ` François Pottier
@ 2017-05-03  1:18   ` Helmut Brandl
  0 siblings, 0 replies; 5+ messages in thread
From: Helmut Brandl @ 2017-05-03  1:18 UTC (permalink / raw)
  To: caml users


> On May 2, 2017, at 14:49, François Pottier <francois.pottier@inria.fr> wrote:
> 
> 
> Hello,
> 
> Le 02/05/2017 19:09, Helmut Brandl a écrit :
>> I continue to have the problem that any assertion failure reported by the
>> runtime system always references the source file of the generated parser
>> (i.e. the .ml file) and not the source file (i.e. the .mly file). Is there
>> any way to ask menhir to use the line numbers of the source file instead of
>> the generated source?
> 
> That's a good question, which I don't think anyone has asked before.
> 
> Looking into this issue, it turns out that if "menhir" is used, then the
> generated .ml file does contain appropriate line number information (such
> as # 4 "sample.mly"), whereas if "menhir --infer" is used, then this
> information is omitted. The difference is observable if Assertion_failure
> is raised. This is definitely a bug, which I will look into.
> Thanks for reporting this!


Thanks for the feedback. I use “—infer” because it has been highly recommended in the manual.

Regards
Helmut

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] menhir should reference source file and not generated source file
  2017-05-02 17:09 [Caml-list] menhir should reference source file and not generated source file Helmut Brandl
  2017-05-02 19:49 ` François Pottier
@ 2017-05-09 19:32 ` François Pottier
  2017-05-11  2:28   ` Helmut Brandl
  1 sibling, 1 reply; 5+ messages in thread
From: François Pottier @ 2017-05-09 19:32 UTC (permalink / raw)
  To: caml-list


Hello,

Le 02/05/2017 19:09, Helmut Brandl a écrit :
> Is there any way to ask menhir to use the line numbers of the source file instead of the generated source?

I believe I have fixed the problem.
I am now submitting an updated opam package,
which should be available soon.

-- 
François Pottier
francois.pottier@inria.fr
http://gallium.inria.fr/~fpottier/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] menhir should reference source file and not generated source file
  2017-05-09 19:32 ` François Pottier
@ 2017-05-11  2:28   ` Helmut Brandl
  0 siblings, 0 replies; 5+ messages in thread
From: Helmut Brandl @ 2017-05-11  2:28 UTC (permalink / raw)
  To: François Pottier; +Cc: caml-list

Thanks a lot. This makes development more convenient.

Regards
Helmut

> On May 9, 2017, at 14:32, François Pottier <francois.pottier@inria.fr> wrote:
> 
> 
> Hello,
> 
> Le 02/05/2017 19:09, Helmut Brandl a écrit :
>> Is there any way to ask menhir to use the line numbers of the source file instead of the generated source?
> 
> I believe I have fixed the problem.
> I am now submitting an updated opam package,
> which should be available soon.
> 
> -- 
> François Pottier
> francois.pottier@inria.fr
> http://gallium.inria.fr/~fpottier/
> 
> -- 
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-05-11 19:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-02 17:09 [Caml-list] menhir should reference source file and not generated source file Helmut Brandl
2017-05-02 19:49 ` François Pottier
2017-05-03  1:18   ` Helmut Brandl
2017-05-09 19:32 ` François Pottier
2017-05-11  2:28   ` Helmut Brandl

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).