caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] modified error messages for ocamlc
@ 2013-04-14 15:20 William Smith
  2013-04-14 16:25 ` Daniel Bünzli
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: William Smith @ 2013-04-14 15:20 UTC (permalink / raw)
  To: Caml-list

[-- Attachment #1: Type: text/plain, Size: 961 bytes --]

Hi,

I've made a change to my copy of ocamlc to modify error messages when 
they cover multiple lines.

For example, for the following code, the modified error message includes 
the line number and character offset of then end of the message instead 
of just the length of the message.

Would there be any interest in me making the change everywhere and 
submitting it as a patch?  I see about a dozen places in the source of 
the various tools where the change would be possible.   One concern I 
have is that it might break automated test scripts.

Bill Smith

let x = 1 in
(match x with
1 -> true
);;
--------
New:
File "multilineError.ml", line 2, character 0-line 4, character 1:
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
0
--------
Old:
File "multilineError.ml", line 2, characters 0-28:
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
0


[-- Attachment #2: Type: text/html, Size: 1707 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [Caml-list] modified error messages for ocamlc
@ 2013-04-18 16:40 William Smith
  2013-04-21  7:37 ` Gabriel Scherer
  0 siblings, 1 reply; 14+ messages in thread
From: William Smith @ 2013-04-18 16:40 UTC (permalink / raw)
  To: Caml-list

[-- Attachment #1: Type: text/plain, Size: 1047 bytes --]

> > File "multilineError.ml", line 2, character 0-line 4, character 1:

> This added info is great, but if you change the format, then please take
> advantage of this opportunity to make use a more standard format so that
> other tools can recognize those messages without extra work.

> E.g:

> multilineError.ml:2.0-4.1: Warning 8: this pattern-matching is not exhaustive.


>        Stefan

This is harder than it looks because there are about a dozen places in the code where OCaml creates error messages.  They're spread out amongst all of the tools.

I believe I found them all, but each one requires careful work to avoid breaking things.   So far, I've only changed the one in ocamlc.  After finding them, I'll also need to learn how to trigger each of them to even test the change.

That's why I don't want to do it unless it's really useful to people.

I don't use emacs right now so I don't know how to test that part of the system.  Will using the standard Gnu error format be ok with what Daniel Bünzli was concerned about?

Bill
  


[-- Attachment #2: Type: text/html, Size: 1520 bytes --]

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

end of thread, other threads:[~2013-04-21 11:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-14 15:20 [Caml-list] modified error messages for ocamlc William Smith
2013-04-14 16:25 ` Daniel Bünzli
2013-04-14 17:06   ` Gabriel Scherer
2013-04-14 17:57     ` Daniel Bünzli
2013-04-14 18:19       ` Jonathan Protzenko
2013-04-14 19:18         ` Daniel Bünzli
2013-04-14 20:01           ` [Caml-list] " Christopher Zimmermann
2013-04-15 15:37   ` [Caml-list] " Jacques Le Normand
2013-04-15  6:26 ` Raphaël Proust
2013-04-16  0:32 ` [Caml-list] " Stefan Monnier
2013-04-18 16:40 [Caml-list] " William Smith
2013-04-21  7:37 ` Gabriel Scherer
2013-04-21 10:53   ` Daniel Bünzli
2013-04-21 11:28     ` Gabriel Scherer

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