From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 2A4E67EE51 for ; Sun, 14 Apr 2013 17:20:14 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of bills@emu-bark.com) identity=pra; client-ip=173.201.192.234; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bills@emu-bark.com"; x-sender="bills@emu-bark.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of bills@emu-bark.com) identity=mailfrom; client-ip=173.201.192.234; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bills@emu-bark.com"; x-sender="bills@emu-bark.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@p3plsmtpa07-05.prod.phx3.secureserver.net) identity=helo; client-ip=173.201.192.234; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bills@emu-bark.com"; x-sender="postmaster@p3plsmtpa07-05.prod.phx3.secureserver.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnoCALfGalGtycDqemdsb2JhbABQgzwBiQ25NhYOAQEJDQkJESuCTVEgHRYYAwIBAgE/DA0IAQGIEJlGoCaSXwOYJoRkjjM X-IPAS-Result: AnoCALfGalGtycDqemdsb2JhbABQgzwBiQ25NhYOAQEJDQkJESuCTVEgHRYYAwIBAgE/DA0IAQGIEJlGoCaSXwOYJoRkjjM X-IronPort-AV: E=Sophos;i="4.87,471,1363129200"; d="scan'208,217";a="10906976" Received: from p3plsmtpa07-05.prod.phx3.secureserver.net ([173.201.192.234]) by mail3-smtp-sop.national.inria.fr with ESMTP; 14 Apr 2013 17:20:11 +0200 Received: from [192.168.0.2] ([173.26.186.224]) by p3plsmtpa07-05.prod.phx3.secureserver.net with id PrL71l0074qv3b901rL7KE; Sun, 14 Apr 2013 08:20:08 -0700 Message-ID: <516AC928.9030400@emu-bark.com> Date: Sun, 14 Apr 2013 11:20:08 -0400 From: William Smith User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 To: Caml-list Content-Type: multipart/alternative; boundary="------------040503050700020309060400" Subject: [Caml-list] modified error messages for ocamlc This is a multi-part message in MIME format. --------------040503050700020309060400 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------040503050700020309060400 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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

--------------040503050700020309060400-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 8A9FA7EE51 for ; Sun, 14 Apr 2013 18:25:49 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=pra; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=mailfrom; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp.webfaction.com) identity=helo; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="postmaster@smtp.webfaction.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApEBAPjXalFKN1ZKnGdsb2JhbABQgzwBgy++EIEaDgEBAQEBBg0JCRQogh8BAQQBI1YFCwsODAImAgJHEAYbAYgFBgQIqAqRU4EjjUEzB4IuMmEDnHcTjhg X-IPAS-Result: ApEBAPjXalFKN1ZKnGdsb2JhbABQgzwBgy++EIEaDgEBAQEBBg0JCRQogh8BAQQBI1YFCwsODAImAgJHEAYbAYgFBgQIqAqRU4EjjUEzB4IuMmEDnHcTjhg X-IronPort-AV: E=Sophos;i="4.87,471,1363129200"; d="scan'208";a="10909510" Received: from mail6.webfaction.com (HELO smtp.webfaction.com) ([74.55.86.74]) by mail3-smtp-sop.national.inria.fr with ESMTP; 14 Apr 2013 18:25:48 +0200 Received: from [172.20.10.2] (94.197.127.134.threembb.co.uk [94.197.127.134]) by smtp.webfaction.com (Postfix) with ESMTP id 4A41A2078718; Sun, 14 Apr 2013 16:25:46 +0000 (UTC) Date: Sun, 14 Apr 2013 17:25:43 +0100 From: =?utf-8?Q?Daniel_B=C3=BCnzli?= To: William Smith Cc: Caml-list Message-ID: In-Reply-To: <516AC928.9030400@emu-bark.com> References: <516AC928.9030400@emu-bark.com> X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Re: [Caml-list] modified error messages for ocamlc Le dimanche, 14 avril 2013 =C3=A0 16:20, William Smith a =C3=A9crit : > Would there be any interest in me making the change everywhere and submit= ting it as a patch? Not at all... =20=20 > One concern I have is that it might break automated test scripts. That may be the case but more importantly your fancy way of reporting error= messages is not recognized by emacs' compilation-mode. ocaml's current way= of reporting allows compilation-mode to perfectly hilight the span of the = error in your source *without* having to tweak the `compilation-error-regex= p-alist` variable. That's not the case of your format. If something has to be changed I'd rather have the gnu standard way of repo= rting errors for ranges [1] which is both more compact and recognized by em= acs' compilation-mode. Best, Daniel [1] http://www.gnu.org/prep/standards/standards.html#Errors From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 42FDA7EE5B for ; Sun, 14 Apr 2013 19:07:17 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.214.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.214.54 as permitted sender) identity=mailfrom; client-ip=209.85.214.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-bk0-f54.google.com) identity=helo; client-ip=209.85.214.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-bk0-f54.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgQCAFvhalHRVdY2k2dsb2JhbAA2GoM8ryeSGXwIFg4BAQEBBwsLCRQEJIIfAQEEAUABGxILAQMMBgULDQ0hIgERAQUBChIGEwkJh28BAwkGDC+cAIwvgnuDWgoZJwMKWYh+AQUMjlgzB4NBA5cFgSGODhYphDA6 X-IPAS-Result: AgQCAFvhalHRVdY2k2dsb2JhbAA2GoM8ryeSGXwIFg4BAQEBBwsLCRQEJIIfAQEEAUABGxILAQMMBgULDQ0hIgERAQUBChIGEwkJh28BAwkGDC+cAIwvgnuDWgoZJwMKWYh+AQUMjlgzB4NBA5cFgSGODhYphDA6 X-IronPort-AV: E=Sophos;i="4.87,471,1363129200"; d="scan'208";a="10911168" Received: from mail-bk0-f54.google.com ([209.85.214.54]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 14 Apr 2013 19:07:16 +0200 Received: by mail-bk0-f54.google.com with SMTP id q16so2034133bkw.27 for ; Sun, 14 Apr 2013 10:07:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=6HT6Hw0ZxCqNYjrVI0qlf7XZ65tU4crWkCdlDYrusbk=; b=d9U+Ek2gSzD0DwF43afqrT1KEw0gXGa4ccgZ6CsATuAuyTpseYdY9SYkk2IRw8yddO K23Xq+0YRRYUrVGRCFfqgCIbQrVZRYL/Nr54U8Z99LemIgzAStKF6I7ZQyIXM0yVNaEO 8OalVuQDZ3X6nUBqNb6dp2B82b1pxZE3VU/JlKhp3PTeArfDfEqTyGt1pNcehv/qdXUr 3IXtjVzeS3IgSmO5NeEG28rPw4hv6N83dcIqDvvIS8w2ffgYCCmgwe6b2ymv98TauhCw op1vR7rUSAjH5iLR14Sck78WyIbS21o5H1/whWp4lnMwfyADQ67q0AH1hVs5z+5DmGhQ 8lZg== X-Received: by 10.204.173.204 with SMTP id q12mr7033896bkz.74.1365959235798; Sun, 14 Apr 2013 10:07:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.205.83.144 with HTTP; Sun, 14 Apr 2013 10:06:35 -0700 (PDT) In-Reply-To: References: <516AC928.9030400@emu-bark.com> From: Gabriel Scherer Date: Sun, 14 Apr 2013 19:06:35 +0200 Message-ID: To: =?ISO-8859-1?Q?Daniel_B=FCnzli?= Cc: William Smith , Caml-list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] modified error messages for ocamlc >> Would there be any interest in me making the change everywhere and submi= tting it as a patch? > > Not at all... I'm not sure if this is a language barrier thing, or sarcasm/irony that got lost on the wire, but my personal reaction would rather be that there indeed is some interest, especially if you follow Daniel's excellent suggestion to respect the standard GNU format for that. On a related note, I have put in http://caml.inria.fr/mantis/view.php?id=3D5044 some hooks for Emacs compile-mode to parse additional error messages that are not supported by default, namely the backtrace format and the location printed in the 'assert false' error message. This is so convenient that I often feed "ocamlbuild test.byte && ./test.byte" as my compilation command in my edit-compile-test cycles. On Sun, Apr 14, 2013 at 6:25 PM, Daniel B=FCnzli wrote: > Le dimanche, 14 avril 2013 =E0 16:20, William Smith a =E9crit : >> Would there be any interest in me making the change everywhere and submi= tting it as a patch? > > Not at all... > >> One concern I have is that it might break automated test scripts. > > That may be the case but more importantly your fancy way of reporting err= or messages is not recognized by emacs' compilation-mode. ocaml's current w= ay of reporting allows compilation-mode to perfectly hilight the span of th= e error in your source *without* having to tweak the `compilation-error-reg= exp-alist` variable. That's not the case of your format. > > If something has to be changed I'd rather have the gnu standard way of re= porting errors for ranges [1] which is both more compact and recognized by = emacs' compilation-mode. > > Best, > > Daniel > > [1] http://www.gnu.org/prep/standards/standards.html#Errors > > -- > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 928317EE51 for ; Sun, 14 Apr 2013 19:57:53 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=pra; client-ip=74.55.86.74; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=mailfrom; client-ip=74.55.86.74; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp.webfaction.com) identity=helo; client-ip=74.55.86.74; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="postmaster@smtp.webfaction.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApEBAAntalFKN1ZKnGdsb2JhbAA2GoM8AYMvvhCBGw4BAQEBAQYNCQkUKIIfAQEEASNWBQsLGgImAgJHEAYbiAYGBAgvp1+RXIEjjUEzB4IuMmEDmCaEUROOGA X-IPAS-Result: ApEBAAntalFKN1ZKnGdsb2JhbAA2GoM8AYMvvhCBGw4BAQEBAQYNCQkUKIIfAQEEASNWBQsLGgImAgJHEAYbiAYGBAgvp1+RXIEjjUEzB4IuMmEDmCaEUROOGA X-IronPort-AV: E=Sophos;i="4.87,471,1363129200"; d="scan'208";a="13206113" Received: from mail6.webfaction.com (HELO smtp.webfaction.com) ([74.55.86.74]) by mail2-smtp-roc.national.inria.fr with ESMTP; 14 Apr 2013 19:57:52 +0200 Received: from [172.20.10.2] (94.197.127.134.threembb.co.uk [94.197.127.134]) by smtp.webfaction.com (Postfix) with ESMTP id 59B8320E003D; Sun, 14 Apr 2013 17:57:46 +0000 (UTC) Date: Sun, 14 Apr 2013 18:57:36 +0100 From: =?utf-8?Q?Daniel_B=C3=BCnzli?= To: Gabriel Scherer Cc: William Smith , Caml-list Message-ID: <93F65479FCAB425282517E571DA027D9@erratique.ch> In-Reply-To: References: <516AC928.9030400@emu-bark.com> X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Re: [Caml-list] modified error messages for ocamlc Le dimanche, 14 avril 2013 =C3=A0 18:06, Gabriel Scherer a =C3=A9crit : > > > Would there be any interest in me making the change everywhere and su= bmitting it as a patch? > >=20=20 > > Not at all... > I'm not sure if this is a language barrier thing, or sarcasm/irony > that got lost on the wire, No, it was a true answer, I'm not interesting in having changes introduced = in ocaml that break features that are useful to me *every* day. Namely the = ability of compilation-mode to precisely hilight the span of an error in my= source, without having to tweak my .emacs. (That's said I'd have nothing a= gainst an implementation of gnu's standard).=20=20 =20=20 > On a related note, I have put in > http://caml.inria.fr/mantis/view.php?id=3D5044 some hooks for Emacs > compile-mode to parse additional error messages that are not supported > by default, namely the backtrace format and the location printed in > the 'assert false' error message.=20=20 I still don't understand your issue here. For me everything works pefectly = out of the box, character ranges included (or maybe I never fell on a speci= fic case ?).=20=20 > This is so convenient that I often > feed "ocamlbuild test.byte && ./test.byte" as my compilation command > in my edit-compile-test cycles. Yes, that's also what I do. Best, Daniel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 5F0377EE51 for ; Sun, 14 Apr 2013 20:19:34 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of jonathan.protzenko@gmail.com) identity=pra; client-ip=209.85.212.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jonathan.protzenko@gmail.com"; x-sender="jonathan.protzenko@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of jonathan.protzenko@gmail.com designates 209.85.212.171 as permitted sender) identity=mailfrom; client-ip=209.85.212.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jonathan.protzenko@gmail.com"; x-sender="jonathan.protzenko@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wi0-f171.google.com) identity=helo; client-ip=209.85.212.171; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jonathan.protzenko@gmail.com"; x-sender="postmaster@mail-wi0-f171.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvEBAAPyalHRVdSrjWdsb2JhbAA2GoJlV4MwvhCBBRYOAQEBAQcLCwkSBiSCHwEBBSMPAQ0BGxwBAQMMBgULDQICBRYLAgIJAwIBAgEREQEFARwGDQEHAQGHfQEDDwELL5wAi2BPgnuDXwoZJw1ZiH4BBQyBF410B4IugRMDlwWBIY4OP4Qw X-IPAS-Result: AvEBAAPyalHRVdSrjWdsb2JhbAA2GoJlV4MwvhCBBRYOAQEBAQcLCwkSBiSCHwEBBSMPAQ0BGxwBAQMMBgULDQICBRYLAgIJAwIBAgEREQEFARwGDQEHAQGHfQEDDwELL5wAi2BPgnuDXwoZJw1ZiH4BBQyBF410B4IugRMDlwWBIY4OP4Qw X-IronPort-AV: E=Sophos;i="4.87,471,1363129200"; d="scan'208";a="10913952" Received: from mail-wi0-f171.google.com ([209.85.212.171]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 14 Apr 2013 20:19:33 +0200 Received: by mail-wi0-f171.google.com with SMTP id hn17so902833wib.16 for ; Sun, 14 Apr 2013 11:19:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=lqHL7zHbPbyUDfvVQWn01QKe9+2sED8qBFVfmVTFUIs=; b=wXsfndUNVlbrSVimieS8Nd/OzOhS80r+FEIpEvQnljuQTN1Fc1Y2V1GgC76r9Ff/Zq VG+stGfa2MejwRbv/hCan7boStKnyPf+ILJ26Lw+GZdt4gTzRJ14ozJLKgts0NCQq0Hl 8ZUrpOAZIk5N5FZVbdTFF43oe5WWyWUE6p0sUtGvjf3xnP3NPYrM70H5B5fnmtwoJlKi o3iQugonzTBrikqwP4G5qgO5Gsad4jQjcIEdjaO0D7KPAzPHY7V3jab9FfN7nDY800WY kI+/ai93Ms/ztr+dXjCjnsNTVqKdjcBOViYxyx6GwfFSyBzmGx3Z3L5NXrjSlF3g5tHy JYuw== X-Received: by 10.194.82.34 with SMTP id f2mr25739004wjy.25.1365963573412; Sun, 14 Apr 2013 11:19:33 -0700 (PDT) Received: from ?IPv6:2a01:e35:2f37:f210:5e26:aff:fe0c:c1d8? ([2a01:e35:2f37:f210:5e26:aff:fe0c:c1d8]) by mx.google.com with ESMTPS id er1sm9276789wib.5.2013.04.14.11.19.31 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 14 Apr 2013 11:19:32 -0700 (PDT) Message-ID: <516AF334.2040202@gmail.com> Date: Sun, 14 Apr 2013 20:19:32 +0200 From: Jonathan Protzenko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: =?UTF-8?B?RGFuaWVsIELDvG56bGk=?= CC: William Smith , Caml-list , Gabriel Scherer References: <516AC928.9030400@emu-bark.com> <93F65479FCAB425282517E571DA027D9@erratique.ch> In-Reply-To: <93F65479FCAB425282517E571DA027D9@erratique.ch> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] modified error messages for ocamlc The OCaml mode for emacs that's distributed along with the OCaml sources contains (caml.el) : 796 ;; Newer emacs versions support line/char ranges 797 ;; We will adapt OCaml to output error messages in a compatible format. 798 ;; In the meantime we add the new format here in addition to the old one. 799 (defconst caml-error-regexp-newstyle 800 "^[ A-\377]+ \"\\([^\"\n]+\\)\", line \\([0-9]+\\), char \\([0-9]+\\) to line \\([0-9]+\\), char \\([0-9]+\\):" 801 "Regular expression matching the error messages produced by ocamlc/ocamlopt.") So there are provisions already in the Emacs mode for parsing multi-line error formats. What refrains us from switching directly to the format that's recognized by the already-distributed Caml mode ? Cheers, jonathan On Sun 14 Apr 2013 07:57:36 PM CEST, Daniel Bünzli wrote: > Le dimanche, 14 avril 2013 à 18:06, Gabriel Scherer a écrit : >>>> Would there be any interest in me making the change everywhere and submitting it as a patch? >>> >>> Not at all... >> I'm not sure if this is a language barrier thing, or sarcasm/irony >> that got lost on the wire, > > No, it was a true answer, I'm not interesting in having changes introduced in ocaml that break features that are useful to me *every* day. Namely the ability of compilation-mode to precisely hilight the span of an error in my source, without having to tweak my .emacs. (That's said I'd have nothing against an implementation of gnu's standard). > > >> On a related note, I have put in >> http://caml.inria.fr/mantis/view.php?id=5044 some hooks for Emacs >> compile-mode to parse additional error messages that are not supported >> by default, namely the backtrace format and the location printed in >> the 'assert false' error message. > > I still don't understand your issue here. For me everything works pefectly out of the box, character ranges included (or maybe I never fell on a specific case ?). > >> This is so convenient that I often >> feed "ocamlbuild test.byte && ./test.byte" as my compilation command >> in my edit-compile-test cycles. > > Yes, that's also what I do. > > Best, > > Daniel > > > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 64F827EE51 for ; Sun, 14 Apr 2013 21:18:31 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=pra; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=mailfrom; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp.webfaction.com) identity=helo; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="postmaster@smtp.webfaction.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApEBAOn/alFKN1ZKnGdsb2JhbABQgz2DL74QgRsOAQEBAQEGDQkJFCiCIAEFI1YQCxoCJgICRxAGG4gMBKgRkVyBI41BMweCLjJhA5x3E44Y X-IPAS-Result: ApEBAOn/alFKN1ZKnGdsb2JhbABQgz2DL74QgRsOAQEBAQEGDQkJFCiCIAEFI1YQCxoCJgICRxAGG4gMBKgRkVyBI41BMweCLjJhA5x3E44Y X-IronPort-AV: E=Sophos;i="4.87,471,1363129200"; d="scan'208";a="10917140" Received: from mail6.webfaction.com (HELO smtp.webfaction.com) ([74.55.86.74]) by mail3-smtp-sop.national.inria.fr with ESMTP; 14 Apr 2013 21:18:30 +0200 Received: from [172.20.10.2] (94.197.127.134.threembb.co.uk [94.197.127.134]) by smtp.webfaction.com (Postfix) with ESMTP id 899F420DFF05; Sun, 14 Apr 2013 19:18:26 +0000 (UTC) Date: Sun, 14 Apr 2013 20:18:21 +0100 From: =?utf-8?Q?Daniel_B=C3=BCnzli?= To: Jonathan Protzenko Cc: William Smith , Caml-list , Gabriel Scherer Message-ID: In-Reply-To: <516AF334.2040202@gmail.com> References: <516AC928.9030400@emu-bark.com> <93F65479FCAB425282517E571DA027D9@erratique.ch> <516AF334.2040202@gmail.com> X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Re: [Caml-list] modified error messages for ocamlc Le dimanche, 14 avril 2013 =C3=A0 19:19, Jonathan Protzenko a =C3=A9crit : > The OCaml mode for emacs that's distributed along with the OCaml=20=20 > sources contains (caml.el) : >=20=20 > 796 ;; Newer emacs versions support line/char ranges > 797 ;; We will adapt OCaml to output error messages in a compatible=20=20 > format. > 798 ;; In the meantime we add the new format here in addition to the=20= =20 > old one. > 799 (defconst caml-error-regexp-newstyle > 800 "^[ A-\377]+ \"\\([^\"\n]+\\)\", line \\([0-9]+\\), char=20=20 > \\([0-9]+\\) to line \\([0-9]+\\), char \\([0-9]+\\):" > 801 "Regular expression matching the error messages produced by=20=20 > ocamlc/ocamlopt.") >=20=20 > So there are provisions already in the Emacs mode for parsing=20=20 > multi-line error formats. What refrains us from switching directly to=20= =20 > the format that's recognized by the already-distributed Caml mode ? This discussion is very confusing. There's nothing special to be done here,= it already works=E2=80=A6 The "old" version of the original message does e= xactly what it needs to do to highlight multiline errors.=20=20 Daniel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 79CCF7EE51 for ; Sun, 14 Apr 2013 22:02:07 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of madroach@gmerlin.de) identity=pra; client-ip=80.91.229.3; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gclci-caml-list@m.gmane.org"; x-sender="madroach@gmerlin.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gclci-caml-list@m.gmane.org designates 80.91.229.3 as permitted sender) identity=mailfrom; client-ip=80.91.229.3; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gclci-caml-list@m.gmane.org"; x-sender="gclci-caml-list@m.gmane.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of postmaster@plane.gmane.org designates 80.91.229.3 as permitted sender) identity=helo; client-ip=80.91.229.3; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gclci-caml-list@m.gmane.org"; x-sender="postmaster@plane.gmane.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvwAADkKa1FQW+UDmWdsb2JhbABQhmy/FRYOAQEBAQEICwsHFCiCHwEBBAEjDwFLCwsaAiYCAlcZiA4KqBORVoEjjhGCGIETA5cElB8 X-IPAS-Result: AvwAADkKa1FQW+UDmWdsb2JhbABQhmy/FRYOAQEBAQEICwsHFCiCHwEBBAEjDwFLCwsaAiYCAlcZiA4KqBORVoEjjhGCGIETA5cElB8 X-IronPort-AV: E=Sophos;i="4.87,471,1363129200"; d="scan'208";a="13212391" Received: from plane.gmane.org ([80.91.229.3]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 14 Apr 2013 22:02:06 +0200 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1URT7l-0005d7-Mx for caml-list@inria.fr; Sun, 14 Apr 2013 22:02:05 +0200 Received: from stgt-d9be592e.pool.mediaways.net ([217.190.89.46]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 14 Apr 2013 22:02:05 +0200 Received: from madroach by stgt-d9be592e.pool.mediaways.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 14 Apr 2013 22:02:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Christopher Zimmermann Date: Sun, 14 Apr 2013 22:01:55 +0200 Message-ID: <20130414220155.94e847e46004cfb5dfca431b@gmerlin.de> References: <516AC928.9030400@emu-bark.com> <93F65479FCAB425282517E571DA027D9@erratique.ch> <516AF334.2040202@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: stgt-d9be592e.pool.mediaways.net X-Newsreader: Sylpheed 3.2.0 (GTK+ 2.24.13; i386-unknown-openbsd5.2) X-Validation-by: madroach@gmerlin.de Subject: [Caml-list] Re: modified error messages for ocamlc On Sun, 14 Apr 2013 20:18:21 +0100 Daniel Bünzli wrote: > Le dimanche, 14 avril 2013 à 19:19, Jonathan Protzenko a écrit : > > The OCaml mode for emacs that's distributed along with the OCaml > > sources contains (caml.el) : > > > > 796 ;; Newer emacs versions support line/char ranges > > 797 ;; We will adapt OCaml to output error messages in a > > compatible format. > > 798 ;; In the meantime we add the new format here in addition to > > the old one. > > 799 (defconst caml-error-regexp-newstyle > > 800 "^[ A-\377]+ \"\\([^\"\n]+\\)\", line \\([0-9]+\\), char > > \\([0-9]+\\) to line \\([0-9]+\\), char \\([0-9]+\\):" > > 801 "Regular expression matching the error messages produced by > > ocamlc/ocamlopt.") > > > > So there are provisions already in the Emacs mode for parsing > > multi-line error formats. What refrains us from switching directly > > to the format that's recognized by the already-distributed Caml > > mode ? > > > This discussion is very confusing. There's nothing special to be done > here, it already works… The "old" version of the original message > does exactly what it needs to do to highlight multiline errors. Yes for emacs, no for everyone else and especially for humans reading the compiler output with their own eyes. Christopher From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 274B47EE51 for ; Mon, 15 Apr 2013 08:26:48 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of raphlalou@gmail.com) identity=pra; client-ip=209.85.223.174; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="raphlalou@gmail.com"; x-sender="raphlalou@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of raphlalou@gmail.com designates 209.85.223.174 as permitted sender) identity=mailfrom; client-ip=209.85.223.174; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="raphlalou@gmail.com"; x-sender="raphlalou@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ie0-f174.google.com) identity=helo; client-ip=209.85.223.174; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="raphlalou@gmail.com"; x-sender="postmaster@mail-ie0-f174.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnMCACuca1HRVd+ulGdsb2JhbABQgzyDML1QfwgWDgEBAQEHCwsJEiqCHwEBBSMdARsdAQMMBgULAwoCAiYCAiIBEQEFARwGEwiHeQEDDwycfItgT4J7g2UKGScNWYh+AQEEDIEXjUEzB4IugRMDlwWPLxYphDA6 X-IPAS-Result: AnMCACuca1HRVd+ulGdsb2JhbABQgzyDML1QfwgWDgEBAQEHCwsJEiqCHwEBBSMdARsdAQMMBgULAwoCAiYCAiIBEQEFARwGEwiHeQEDDwycfItgT4J7g2UKGScNWYh+AQEEDIEXjUEzB4IugRMDlwWPLxYphDA6 X-IronPort-AV: E=Sophos;i="4.87,473,1363129200"; d="scan'208";a="10950898" Received: from mail-ie0-f174.google.com ([209.85.223.174]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 15 Apr 2013 08:26:47 +0200 Received: by mail-ie0-f174.google.com with SMTP id 10so603572ied.19 for ; Sun, 14 Apr 2013 23:26:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=IpFot3xlwt5tHQWRlvFTigVxmHtfuwO3puEYZCBeaAE=; b=OTY5KtL7ebXuuMjLKLXEcAWOVInuZq2dqI9w3a8rmU64ALj42UIqE1Jfkja/+GRQ0E 77aumkQ6L/6NHilM1wwNyn0gM0Rq7popeCBuOXKk70njshTwRYsliKUlyCwRai9kasmm +6qV3SpZDUnSGPGbI3ZR28A/Mvym0mtCa06KR5eftvTW44Z8i6TOeIK2wHFszWD03K2T //M0Pjs8J1eIQr0gTxquKZmEBnrBRbwoPyKhis7J1KBNxS7Z2rBl7sS4LGh6Zp0Mgj7d oJdeezPn6LRSdiMNbeYfx73c2RJA2oZJETLpYuXmx041CBQD7i0ugYJLOR4nnKWXB0R5 nQMg== MIME-Version: 1.0 X-Received: by 10.50.94.201 with SMTP id de9mr4486724igb.99.1366007205935; Sun, 14 Apr 2013 23:26:45 -0700 (PDT) Received: by 10.42.18.9 with HTTP; Sun, 14 Apr 2013 23:26:45 -0700 (PDT) In-Reply-To: <516AC928.9030400@emu-bark.com> References: <516AC928.9030400@emu-bark.com> Date: Mon, 15 Apr 2013 08:26:45 +0200 Message-ID: From: =?UTF-8?Q?Rapha=C3=ABl_Proust?= To: William Smith Cc: Caml-list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] modified error messages for ocamlc On Sun, Apr 14, 2013 at 5:20 PM, William Smith wrote: > Hi, > > I've made a change to my copy of ocamlc to modify error messages when they > cover multiple lines. I have a similar fork of the OCaml compiler with shorter/more standard/easier to regexp/simpler to parse/*plan9's acme friendly* (the last point was the most important for me): https://github.com/raphael-proust/ocaml/commit/a5cb1414b590d3e0f49c2ee87bcb= 90459e34fcde The way I distribute it (to myself, i.e. to my different machines) is via o= pam: https://github.com/raphael-proust/opam-repo It's an easy way to make it available not only to oneself, but to anyone (with an opam installation) interested. (Any acme users out there?) And it doesn't need to be patched in the main repository. Cheers, --=20 ______________ Rapha=C3=ABl Proust From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 2E59C7EE51 for ; Mon, 15 Apr 2013 17:37:28 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of rathereasy@gmail.com) identity=pra; client-ip=209.85.220.181; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="rathereasy@gmail.com"; x-sender="rathereasy@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of rathereasy@gmail.com designates 209.85.220.181 as permitted sender) identity=mailfrom; client-ip=209.85.220.181; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="rathereasy@gmail.com"; x-sender="rathereasy@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-vc0-f181.google.com) identity=helo; client-ip=209.85.220.181; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="rathereasy@gmail.com"; x-sender="postmaster@mail-vc0-f181.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtoDAIkdbFHRVdy1lWdsb2JhbABQgzyuaIljAYg4fwgWDgEBAQEHDQkJEiqCHwEBBAFAARsSCwEDAQsGBQQHGiEiAREBBQEKEgYTCQmHbwEDCQYMnW6ML4J7hCAKGScDClmIfgEFDI8HBAeDQQOJBY4AgSGODhYphE4c X-IPAS-Result: AtoDAIkdbFHRVdy1lWdsb2JhbABQgzyuaIljAYg4fwgWDgEBAQEHDQkJEiqCHwEBBAFAARsSCwEDAQsGBQQHGiEiAREBBQEKEgYTCQmHbwEDCQYMnW6ML4J7hCAKGScDClmIfgEFDI8HBAeDQQOJBY4AgSGODhYphE4c X-IronPort-AV: E=Sophos;i="4.87,476,1363129200"; d="scan'208";a="13362606" Received: from mail-vc0-f181.google.com ([209.85.220.181]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 15 Apr 2013 17:37:27 +0200 Received: by mail-vc0-f181.google.com with SMTP id ia10so4045362vcb.12 for ; Mon, 15 Apr 2013 08:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=KzBttcY/jE7BuTtZSBdmW7ycoksmQlBEFQTqKjXM3+U=; b=hV0S6SswX/b+cJrRTLGXyQtUPqf7D+hDGApQK7QdYdDhuHyRXoy2hzhhC2J+92nkmo ulu1oGIi/BlZFhYJxmVeatZuqTj6rmXBWKGWXQwGp7YaeDAnRD630VIfS0+CJ6cVuUjL 0eE+y8SLs4CVHEr9+WwBVe+osatYnNylUjIvgsqQnHl8li4Wuajgw7gNtNgkgozBqRvg ztl+NajNd6K/7gUu9z2npjD8/CfZ7vqQD8PiMCQonmh0QD3/6+ToOUMhGPwLJD0jVR1x GWdSJ7/szndY0ttVWZq5AexBsAVEfBqUQ6MWjFTBkbEIX+mJ3U4jkfPKurWRu135o6qS WVHA== MIME-Version: 1.0 X-Received: by 10.52.100.163 with SMTP id ez3mr13881926vdb.6.1366040246285; Mon, 15 Apr 2013 08:37:26 -0700 (PDT) Received: by 10.220.200.66 with HTTP; Mon, 15 Apr 2013 08:37:26 -0700 (PDT) Received: by 10.220.200.66 with HTTP; Mon, 15 Apr 2013 08:37:26 -0700 (PDT) In-Reply-To: References: <516AC928.9030400@emu-bark.com> Date: Mon, 15 Apr 2013 08:37:26 -0700 Message-ID: From: Jacques Le Normand To: =?ISO-8859-1?Q?Daniel_B=FCnzli?= Cc: William Smith , caml Content-Type: multipart/alternative; boundary=20cf307ca044a18f8104da680713 Subject: Re: [Caml-list] modified error messages for ocamlc --20cf307ca044a18f8104da680713 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I'd also like to see the standard gnu way. On Apr 14, 2013 9:26 AM, "Daniel B=FCnzli" wrote: > Le dimanche, 14 avril 2013 =E0 16:20, William Smith a =E9crit : > > Would there be any interest in me making the change everywhere and > submitting it as a patch? > > Not at all... > > > One concern I have is that it might break automated test scripts. > > That may be the case but more importantly your fancy way of reporting > error messages is not recognized by emacs' compilation-mode. ocaml's > current way of reporting allows compilation-mode to perfectly hilight the > span of the error in your source *without* having to tweak the > `compilation-error-regexp-alist` variable. That's not the case of your > format. > > If something has to be changed I'd rather have the gnu standard way of > reporting errors for ranges [1] which is both more compact and recognized > by emacs' compilation-mode. > > Best, > > Daniel > > [1] http://www.gnu.org/prep/standards/standards.html#Errors > > -- > 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 --20cf307ca044a18f8104da680713 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

I'd also like to see the standard gnu way.

On Apr 14, 2013 9:26 AM, "Daniel B=FCnzli&q= uot; <daniel.buenzli@erra= tique.ch> wrote:
Le dimanche, 14 avril 2013 =E0 16:20, William Smith a =E9crit :
> Would there be any interest in me making the change everywhere and sub= mitting it as a patch?

Not at all...

> One concern I have is that it might break automated test scripts.

That may be the case but more importantly your fancy way of reporting error= messages is not recognized by emacs' compilation-mode. ocaml's cur= rent way of reporting allows compilation-mode to perfectly hilight the span= of the error in your source *without* having to tweak the `compilation-err= or-regexp-alist` variable. That's not the case of your format.

If something has to be changed I'd rather have the gnu standard way of = reporting errors for ranges [1] which is both more compact and recognized b= y emacs' compilation-mode.

Best,

Daniel

[1] http://www.gnu.org/prep/standards/standards.html#Errors<= br>
--
Caml-list mailing list. =A0Subscription management and archives:
ht= tps://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
--20cf307ca044a18f8104da680713-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id BE8B57EE51 for ; Tue, 16 Apr 2013 02:32:55 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of monnier@iro.umontreal.ca) identity=pra; client-ip=80.91.229.3; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gclci-caml-list@m.gmane.org"; x-sender="monnier@iro.umontreal.ca"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gclci-caml-list@m.gmane.org designates 80.91.229.3 as permitted sender) identity=mailfrom; client-ip=80.91.229.3; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gclci-caml-list@m.gmane.org"; x-sender="gclci-caml-list@m.gmane.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of postmaster@plane.gmane.org designates 80.91.229.3 as permitted sender) identity=helo; client-ip=80.91.229.3; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gclci-caml-list@m.gmane.org"; x-sender="postmaster@plane.gmane.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah0BALabbFFQW+UDmWdsb2JhbABQgzyCab8jFg4BAQEBAQgLCwcUKIIfAQEEAX4LC0YUKBuIJwYEvBmPNIMrA5gmjhGFBg X-IPAS-Result: Ah0BALabbFFQW+UDmWdsb2JhbABQgzyCab8jFg4BAQEBAQgLCwcUKIIfAQEEAX4LC0YUKBuIJwYEvBmPNIMrA5gmjhGFBg X-IronPort-AV: E=Sophos;i="4.87,479,1363129200"; d="scan'208";a="11072008" Received: from plane.gmane.org ([80.91.229.3]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 16 Apr 2013 02:32:54 +0200 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1URtpL-0005VD-Rl for caml-list@inria.fr; Tue, 16 Apr 2013 02:32:51 +0200 Received: from 206-248-176-29.dsl.teksavvy.com ([206.248.176.29]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Apr 2013 02:32:51 +0200 Received: from monnier by 206-248-176-29.dsl.teksavvy.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Apr 2013 02:32:51 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Stefan Monnier Date: Mon, 15 Apr 2013 20:32:41 -0400 Message-ID: References: <516AC928.9030400@emu-bark.com> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 206-248-176-29.dsl.teksavvy.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:2224Wm3gaK1Nm41KYInr0ZYks7k= X-Validation-by: monnier@iro.umontreal.ca Subject: [Caml-list] Re: modified error messages for ocamlc > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 951F97EE51 for ; Thu, 18 Apr 2013 18:40:34 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of bills@emu-bark.com) identity=pra; client-ip=173.201.192.108; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bills@emu-bark.com"; x-sender="bills@emu-bark.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of bills@emu-bark.com) identity=mailfrom; client-ip=173.201.192.108; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bills@emu-bark.com"; x-sender="bills@emu-bark.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@p3plsmtpa06-07.prod.phx3.secureserver.net) identity=helo; client-ip=173.201.192.108; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bills@emu-bark.com"; x-sender="postmaster@p3plsmtpa06-07.prod.phx3.secureserver.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgADAAghcFGtycBsemdsb2JhbABQgkJ6iQ+4URYOAQEJDQkJESuCHwEBBHkGGgEcFhgDAgECAT8MDQgBAYgKBp0/oT6SZgOYKoRkjjQ X-IPAS-Result: AgADAAghcFGtycBsemdsb2JhbABQgkJ6iQ+4URYOAQEJDQkJESuCHwEBBHkGGgEcFhgDAgECAT8MDQgBAYgKBp0/oT6SZgOYKoRkjjQ X-IronPort-AV: E=Sophos;i="4.87,502,1363129200"; d="scan'208,217";a="11458929" Received: from p3plsmtpa06-07.prod.phx3.secureserver.net ([173.201.192.108]) by mail3-smtp-sop.national.inria.fr with ESMTP; 18 Apr 2013 18:40:32 +0200 Received: from [192.168.0.2] ([173.26.186.224]) by p3plsmtpa06-07.prod.phx3.secureserver.net with id RUgS1l00M4qv3b901UgTos; Thu, 18 Apr 2013 09:40:28 -0700 Message-ID: <51702200.1050806@emu-bark.com> Date: Thu, 18 Apr 2013 12:40:32 -0400 From: William Smith User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 To: Caml-list Content-Type: multipart/alternative; boundary="------------080809000804000808080907" Subject: [Caml-list] modified error messages for ocamlc This is a multi-part message in MIME format. --------------080809000804000808080907 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit > > 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 --------------080809000804000808080907 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
> 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
 
--------------080809000804000808080907-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 4B2FF7EE51 for ; Sun, 21 Apr 2013 09:38:11 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.214.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.214.54 as permitted sender) identity=mailfrom; client-ip=209.85.214.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-bk0-f54.google.com) identity=helo; client-ip=209.85.214.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-bk0-f54.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgoCAAKWc1HRVdY2lGdsb2JhbABPgzzBBnsIFg4BAQEBBw0JCRQEJIIfAQEFQAEbHQEDDAYFCwMKLiIBEQEFARwGEwiHeQEDD54OjDCCe4NLChknDVmIfgEFDI8AMweDRwOXFYEjjhMWKYQxOg X-IPAS-Result: AgoCAAKWc1HRVdY2lGdsb2JhbABPgzzBBnsIFg4BAQEBBw0JCRQEJIIfAQEFQAEbHQEDDAYFCwMKLiIBEQEFARwGEwiHeQEDD54OjDCCe4NLChknDVmIfgEFDI8AMweDRwOXFYEjjhMWKYQxOg X-IronPort-AV: E=Sophos;i="4.87,519,1363129200"; d="scan'208";a="11686158" Received: from mail-bk0-f54.google.com ([209.85.214.54]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 21 Apr 2013 09:38:10 +0200 Received: by mail-bk0-f54.google.com with SMTP id q16so2242804bkw.27 for ; Sun, 21 Apr 2013 00:38:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=4KDVvtrwO87wNlXo2QY4xDPDOEwoL4qma/zxCHsG5bI=; b=z+1lzlBVdr1D++aih77LAivjHxlb72+ekhMfOeeJmy1DNyxfZdQz/eMGw3Ts5bc192 8apMRH+Z85cgipjay4Eo4GXmyfIebzmAI5ZD4Mp6qX/hhBmI4elKKfNzXu40C9aRjSGy KSHTnkpfZpHCVPh4EYQ/kNxnyA1QFQmyP1werd6KAFoUMPFpW34RCuS9+4fMuvqcJjE9 cFrLBMozrwRIx0taTcNv8EmoY4cY8xn7k43rb48fs1gH4xrU0ys0UF5JF2VI/XlRW1gb uM/2tTJCGueXBFOVrQfrPvL3hBB5eoUi48CfTL715RkAlwkAUPKsx2pn4Iajh/x01e0Y j8gw== X-Received: by 10.205.33.81 with SMTP id sn17mr8520686bkb.53.1366529889912; Sun, 21 Apr 2013 00:38:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.205.83.144 with HTTP; Sun, 21 Apr 2013 00:37:28 -0700 (PDT) In-Reply-To: <51702200.1050806@emu-bark.com> References: <51702200.1050806@emu-bark.com> From: Gabriel Scherer Date: Sun, 21 Apr 2013 09:37:28 +0200 Message-ID: To: William Smith Cc: Caml-list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] modified error messages for ocamlc One use case would be supporting other editors in an easier way. I just tried OCaml with Geany, and apparently the people that wrote Geany's OCaml mode didn't bother with a custom error regexp parser. If we had a command-line option to the compiler to produce gnu-standard error messages, that would be a non-issue. I think a patch affecting the error and warning-printing functions of the Location module (parsing/location.ml) should be a very satisfying first step (what kind of errors are you thinking about that aren't handled by these functions?). I'm considering writing such a patch. On Thu, Apr 18, 2013 at 6:40 PM, William Smith wrote: >> 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=FCnzli was concerned about? > > Bill > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id E04B87EE51 for ; Sun, 21 Apr 2013 12:54:19 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=pra; client-ip=74.55.86.74; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=mailfrom; client-ip=74.55.86.74; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp.webfaction.com) identity=helo; client-ip=74.55.86.74; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="postmaster@smtp.webfaction.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmYBAC7Ec1FKN1ZKnGdsb2JhbAA2GoM8gzG9UoEWDgEBAQEBBg0JCRQogh8BAQQBIwRSBQsLGgImAgJHEAYbiAYGBAgvqR+RR4EjjFqBDzMHgjQyYQOYOIRVE44agXI X-IPAS-Result: AmYBAC7Ec1FKN1ZKnGdsb2JhbAA2GoM8gzG9UoEWDgEBAQEBBg0JCRQogh8BAQQBIwRSBQsLGgImAgJHEAYbiAYGBAgvqR+RR4EjjFqBDzMHgjQyYQOYOIRVE44agXI X-IronPort-AV: E=Sophos;i="4.87,519,1363129200"; d="scan'208";a="14210264" Received: from mail6.webfaction.com (HELO smtp.webfaction.com) ([74.55.86.74]) by mail2-smtp-roc.national.inria.fr with ESMTP; 21 Apr 2013 12:54:18 +0200 Received: from [172.20.10.2] (94.197.127.112.threembb.co.uk [94.197.127.112]) by smtp.webfaction.com (Postfix) with ESMTP id C129520DF6FD; Sun, 21 Apr 2013 10:53:53 +0000 (UTC) Date: Sun, 21 Apr 2013 11:53:51 +0100 From: =?utf-8?Q?Daniel_B=C3=BCnzli?= To: Gabriel Scherer Cc: William Smith , Caml-list Message-ID: In-Reply-To: References: <51702200.1050806@emu-bark.com> X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Re: [Caml-list] modified error messages for ocamlc Le dimanche, 21 avril 2013 =C3=A0 08:37, Gabriel Scherer a =C3=A9crit : > I think a patch affecting the error and warning-printing functions of > the Location module (parsing/location.ml) should be a very satisfying > first step (what kind of errors are you thinking about that aren't > handled by these functions?). I'm considering writing such a patch. Stacktraces in printexc.ml are an example (OT but if you are changing thing= s in printexc could maybe grant the whish of that comment [1]...). There ar= e quite a few places, see the end of this email for an over approximation o= f the places to change. Also please make sure to update caml.el so that it works. Should be mainly = about the caml-error-regexp, caml-error-chars-regexp constants. Maybe, beca= use of the standardization it's actually just a matter of removing the addi= tion made to compilation-error-regexp-alist.=20=20 Best, Daniel [1] http://caml.inria.fr/mantis/view.php?id=3D5899#c8779 > git grep "\"File" asmcomp/asmpackager.ml: fprintf ppf "File %a@ was not compiled with the `-f= or-pack %s' option" asmcomp/asmpackager.ml: fprintf ppf "File %s not found" file bytecomp/bytepackager.ml: fprintf ppf "File %a redefines %s" bytecomp/bytepackager.ml: fprintf ppf "File %s not found" file camlp4/Camlp4/Struct/Loc.ml: let res =3D sprintf "File \"%s\", line %d, cha= racters %d-%d" camlp4/boot/Camlp4.ml: sprintf "File \"%s\", line %d, characters %d-%d" x.f= ile_name debugger/loadprinter.ml: fprintf ppf "File %s loaded@." filename; experimental/doligez/checkheaders: printf ("File \"%s\", line %d:\n", FILEN= AME, FNR); lex/main.ml: "File \"%s\", line %d, character %d: character set expected.\n" lex/main.ml: "File \"%s\", line %d, character %d: syntax error.\n" lex/main.ml: "File \"%s\", line %d, character %d: %s.\n" lex/main.ml: "File \"%s\":\n Position memory overflow, too many bindings\n" lex/main.ml: "File \"%s\":\ntransition table overflow, automaton is too big= \n" lex/parser.mly: Printf.eprintf "File \"%s\", line %d, character %d:\n\ ocamlbuild/configuration.ml: parse_lexbuf ?dir (Printf.sprintf "File %S" fi= le) (Lexing.from_channel ic) ocamlbuild/hygiene.ml: Some(sf "File %s in %s has suffix %s" name path suff= ix) ocamlbuild/hygiene.ml: Some(sf "Files %s and %s should not be together in %= s" name name' path) ocamlbuild/testsuite/level0.ml: ["*:a", "File \"_tags\", line 1, column 0: = Lexing error: Invalid globbing pattern \"*\"."; ocamlbuild/testsuite/level0.ml: "\n<*{>:a", "File \"_tags\", line 2, column= 0: Lexing error: Invalid globbing pattern \"<*{>\"."; ocamlbuild/testsuite/level0.ml: "<*>: ~@a,# ~a", "File \"_tags\", line 1, c= olumn 10: Lexing error: Only ',' separated tags are alllowed."];; ocamldoc/odoc_messages.ml:let file_generated f =3D "File "^f^" generated." ocamldoc/odoc_messages.ml: "File "^f^" exists, we don't generate it." otherlibs/dynlink/dynlink.ml: Printf.sprintf "File_not_found %S" s otherlibs/labltk/browser/editor.ml: val file_menu =3D new Jg_menu.c "File" = ~parent:menus otherlibs/labltk/browser/editor.ml: ("File `" ^ name ^ "' exists. Overwrite= it?") otherlibs/labltk/browser/fileselect.ml: let dfrl =3D Label.create dfr ~text= :"Files" in otherlibs/labltk/browser/shell.ml: let file_menu =3D new Jg_menu.c "File" ~= parent:menus otherlibs/labltk/browser/viewer.ml: let filemenu =3D new Jg_menu.c "File" ~= parent:menus otherlibs/labltk/browser/viewer.ml: let filemenu =3D new Jg_menu.c "File" ~= parent:menus otherlibs/labltk/compiler/maincompile.ml: prerr_string "File \""; prerr_str= ing !input_name; otherlibs/labltk/examples_camltk/fileopen.ml:let t =3D Label.create cvs [Te= xt "File name"];; otherlibs/labltk/examples_camltk/winskel.ml: let file =3D Menubutton.create= mbar [Text "File"; UnderlinedChar 0] otherlibs/labltk/jpf/fileselect.ml: let dfrl =3D Label.create dfr ~text: "F= iles" in parsing/location.ml: ("File \"", "\", line ", ", characters ", "-", ":") stdlib/filename.ml: if n < 0 then invalid_arg "Filename.chop_suffix" else S= tring.sub name 0 n stdlib/filename.ml: if i < 0 || is_dir_sep name i then invalid_arg "Filenam= e.chop_extension" stdlib/printexc.ml:let locfmt =3D format_of_string "File \"%s\", line %d, c= haracters %d-%d: %s";; testsuite/Makefile: @if [ ! -f $(FILE) ]; then echo "File '$(FILE)' does no= t exist."; exit 1; fi tools/cmt2annot.ml: Printf.fprintf stderr "File was generated with an error= \n%!"; tools/cmt2annot.ml: Printf.fprintf stderr "File was generated with an error= \n%!"; tools/dumpobj.ml: printf "File \"%s\", line %d, characters %d-%d:\n" ls.Lex= ing.pos_fname tools/objinfo.ml: printf "File %s\n" filename; tools/scrapelabels.ml: "Event"; "Filename"; "Format"; "Gc"; "Genlex"; "Grap= hics"; toplevel/opttopdirs.ml: | None -> fprintf ppf "File not found: %s@." name0;= false toplevel/topdirs.ml: fprintf ppf "File %s is not a bytecode object file.@."= name; yacc/error.c: fprintf(stderr, "File \"%s\", line %d: unexpected end-of-file= \n", yacc/error.c: fprintf(stderr, "File \"%s\", line %d: syntax error\n", yacc/error.c: fprintf(stderr, "File \"%s\", line %d: unmatched /*\n", yacc/error.c: fprintf(stderr, "File \"%s\", line %d: unterminated string\n", yacc/error.c: fprintf(stderr, "File \"%s\", line %d: unmatched %%{\n", yacc/error.c: fprintf(stderr, "File \"%s\", line %d: unterminated %%union d= eclaration\n", yacc/error.c: fprintf(stderr, "File \"%s\", line %d: too many %%union decla= rations\n", yacc/error.c: fprintf(stderr, "File \"%s\", line %d: illegal tag\n", yacc/error.c: fprintf(stderr, "File \"%s\", line %d: illegal character\n", yacc/error.c: fprintf(stderr, "File \"%s\", line %d: illegal use of reserve= d symbol \ yacc/error.c: fprintf(stderr, "File \"%s\", line %d: the start symbol `%s' = cannot \ yacc/error.c: fprintf(stderr, "File \"%s\", line %d: warning: the type of `= %s' has been \ yacc/error.c: fprintf(stderr, "File \"%s\", line %d: warning: the precedenc= e of `%s' has \ yacc/error.c: fprintf(stderr, "File \"%s\", line %d: warning: the value of = `%s' has been \ yacc/error.c: fprintf(stderr, "File \"%s\", line %d: the entry point `%s' i= s a \ yacc/error.c: fprintf(stderr, "File \"%s\", line %d: more than 256 entry po= ints\n", yacc/error.c: fprintf(stderr, "File \"%s\", line %d: no grammar has been sp= ecified\n", yacc/error.c: fprintf(stderr, "File \"%s\", line %d: a token appears on the= lhs \ yacc/error.c: fprintf(stderr, "File \"%s\", line %d: warning: conflicting %= %prec \ yacc/error.c: fprintf(stderr, "File \"%s\", line %d: unterminated action\n", yacc/error.c: fprintf(stderr, "File \"%s\", line %d: warning: $%d reference= s beyond the \ yacc/error.c: fprintf(stderr, "File \"%s\", line %d: illegal $-name\n", yacc/error.c: fprintf(stderr, "File \"%s\", line %d: $$ is untyped\n", yacc/error.c: fprintf(stderr, "File \"%s\", line %d: $%d (%s) is untyped\n", yacc/error.c: fprintf(stderr, "File \"%s\", line %d: $%d is unbound\n", yacc/error.c: fprintf(stderr, "File \"%s\", line %d: $%d refers to terminal= `%s', \ yacc/error.c: fprintf(stderr, "File \"%s\", line %d: no action specified fo= r this \ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 4C7627EE51 for ; Sun, 21 Apr 2013 13:28:44 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.214.42; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.214.42 as permitted sender) identity=mailfrom; client-ip=209.85.214.42; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-bk0-f42.google.com) identity=helo; client-ip=209.85.214.42; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-bk0-f42.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgoCAHHMc1HRVdYqk2dsb2JhbAA2GoM8wQN4CBYOAQEBAQcLCwkUBCSCHwEBBScZARsdAQMMBgULDS4iAREBBQEcBhOIAQEDDwwvnUCMMIJ7g0kKGScNWYh+AQUMjXGBDzMHg0cDlxWBI44TFimEMTqBNw X-IPAS-Result: AgoCAHHMc1HRVdYqk2dsb2JhbAA2GoM8wQN4CBYOAQEBAQcLCwkUBCSCHwEBBScZARsdAQMMBgULDS4iAREBBQEcBhOIAQEDDwwvnUCMMIJ7g0kKGScNWYh+AQUMjXGBDzMHg0cDlxWBI44TFimEMTqBNw X-IronPort-AV: E=Sophos;i="4.87,519,1363129200"; d="scan'208";a="14212708" Received: from mail-bk0-f42.google.com ([209.85.214.42]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 21 Apr 2013 13:28:43 +0200 Received: by mail-bk0-f42.google.com with SMTP id jc3so2239437bkc.15 for ; Sun, 21 Apr 2013 04:28:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=8yzM2MUNr0pf+KT3pIosAOYcNy+O/orm838dobAqEFw=; b=L3lNegLRnnkIhOTk93OhTrxPTCbcB7QI7e+Ehy/w2M0oozcFwz5tqKLJb9awU/qEZn ximK/nio8EjYfAVlZywP2VG3zH6VOIulcQSncxVMRNgE/s2eSYDITAb/V51VwH3zNUxn 0ZBSyBtmaXH8/HBTOvQBwA6PESeZMapFrWiuSs6vWdtXbOogkcTq1YGDlynPMAgf79kP EaFzIw8py/vS/CYRSD72SaK226H9VtYOUqw2NtbTWrdaDnnoEC4XLqvdZ4eDsnXMChzQ mRyWPYn7tIXyvRv7OjeNVF6S/uycJyI4TMtwTtDGyfKAGjQrhfaTOqKqwDtaaWSl2imW yLwQ== X-Received: by 10.205.6.202 with SMTP id ol10mr8879685bkb.94.1366543723118; Sun, 21 Apr 2013 04:28:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.205.83.144 with HTTP; Sun, 21 Apr 2013 04:28:02 -0700 (PDT) In-Reply-To: References: <51702200.1050806@emu-bark.com> From: Gabriel Scherer Date: Sun, 21 Apr 2013 13:28:02 +0200 Message-ID: To: =?ISO-8859-1?Q?Daniel_B=FCnzli?= Cc: William Smith , Caml-list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] modified error messages for ocamlc In any case, I was thinking of an optional flag to use gnu-style error messages. I'm not sure they're actually better in the general case (Modulo the question of the end position, I personally prefer the current format for human readability), and there are surely error-message-parsing scripts around that I don't want to break -- people tend to get feral about their editor configuration. On Sun, Apr 21, 2013 at 12:53 PM, Daniel B=FCnzli wrote: > > > Le dimanche, 21 avril 2013 =E0 08:37, Gabriel Scherer a =E9crit : > >> I think a patch affecting the error and warning-printing functions of >> the Location module (parsing/location.ml) should be a very satisfying >> first step (what kind of errors are you thinking about that aren't >> handled by these functions?). I'm considering writing such a patch. > > Stacktraces in printexc.ml are an example (OT but if you are changing thi= ngs in printexc could maybe grant the whish of that comment [1]...). There = are quite a few places, see the end of this email for an over approximation= of the places to change. > > Also please make sure to update caml.el so that it works. Should be mainl= y about the caml-error-regexp, caml-error-chars-regexp constants. Maybe, be= cause of the standardization it's actually just a matter of removing the ad= dition made to compilation-error-regexp-alist. > > Best, > > Daniel > > [1] http://caml.inria.fr/mantis/view.php?id=3D5899#c8779 > > >> git grep "\"File" > asmcomp/asmpackager.ml: fprintf ppf "File %a@ was not compiled with the `= -for-pack %s' option" > asmcomp/asmpackager.ml: fprintf ppf "File %s not found" file > bytecomp/bytepackager.ml: fprintf ppf "File %a redefines %s" > bytecomp/bytepackager.ml: fprintf ppf "File %s not found" file > camlp4/Camlp4/Struct/Loc.ml: let res =3D sprintf "File \"%s\", line %d, c= haracters %d-%d" > camlp4/boot/Camlp4.ml: sprintf "File \"%s\", line %d, characters %d-%d" x= .file_name > debugger/loadprinter.ml: fprintf ppf "File %s loaded@." filename; > experimental/doligez/checkheaders: printf ("File \"%s\", line %d:\n", FIL= ENAME, FNR); > lex/main.ml: "File \"%s\", line %d, character %d: character set expected.= \n" > lex/main.ml: "File \"%s\", line %d, character %d: syntax error.\n" > lex/main.ml: "File \"%s\", line %d, character %d: %s.\n" > lex/main.ml: "File \"%s\":\n Position memory overflow, too many bindings\= n" > lex/main.ml: "File \"%s\":\ntransition table overflow, automaton is too b= ig\n" > lex/parser.mly: Printf.eprintf "File \"%s\", line %d, character %d:\n\ > ocamlbuild/configuration.ml: parse_lexbuf ?dir (Printf.sprintf "File %S" = file) (Lexing.from_channel ic) > ocamlbuild/hygiene.ml: Some(sf "File %s in %s has suffix %s" name path su= ffix) > ocamlbuild/hygiene.ml: Some(sf "Files %s and %s should not be together in= %s" name name' path) > ocamlbuild/testsuite/level0.ml: ["*:a", "File \"_tags\", line 1, column 0= : Lexing error: Invalid globbing pattern \"*\"."; > ocamlbuild/testsuite/level0.ml: "\n<*{>:a", "File \"_tags\", line 2, colu= mn 0: Lexing error: Invalid globbing pattern \"<*{>\"."; > ocamlbuild/testsuite/level0.ml: "<*>: ~@a,# ~a", "File \"_tags\", line 1,= column 10: Lexing error: Only ',' separated tags are alllowed."];; > ocamldoc/odoc_messages.ml:let file_generated f =3D "File "^f^" generated." > ocamldoc/odoc_messages.ml: "File "^f^" exists, we don't generate it." > otherlibs/dynlink/dynlink.ml: Printf.sprintf "File_not_found %S" s > otherlibs/labltk/browser/editor.ml: val file_menu =3D new Jg_menu.c "File= " ~parent:menus > otherlibs/labltk/browser/editor.ml: ("File `" ^ name ^ "' exists. Overwri= te it?") > otherlibs/labltk/browser/fileselect.ml: let dfrl =3D Label.create dfr ~te= xt:"Files" in > otherlibs/labltk/browser/shell.ml: let file_menu =3D new Jg_menu.c "File"= ~parent:menus > otherlibs/labltk/browser/viewer.ml: let filemenu =3D new Jg_menu.c "File"= ~parent:menus > otherlibs/labltk/browser/viewer.ml: let filemenu =3D new Jg_menu.c "File"= ~parent:menus > otherlibs/labltk/compiler/maincompile.ml: prerr_string "File \""; prerr_s= tring !input_name; > otherlibs/labltk/examples_camltk/fileopen.ml:let t =3D Label.create cvs [= Text "File name"];; > otherlibs/labltk/examples_camltk/winskel.ml: let file =3D Menubutton.crea= te mbar [Text "File"; UnderlinedChar 0] > otherlibs/labltk/jpf/fileselect.ml: let dfrl =3D Label.create dfr ~text: = "Files" in > parsing/location.ml: ("File \"", "\", line ", ", characters ", "-", ":") > stdlib/filename.ml: if n < 0 then invalid_arg "Filename.chop_suffix" else= String.sub name 0 n > stdlib/filename.ml: if i < 0 || is_dir_sep name i then invalid_arg "Filen= ame.chop_extension" > stdlib/printexc.ml:let locfmt =3D format_of_string "File \"%s\", line %d,= characters %d-%d: %s";; > testsuite/Makefile: @if [ ! -f $(FILE) ]; then echo "File '$(FILE)' does = not exist."; exit 1; fi > tools/cmt2annot.ml: Printf.fprintf stderr "File was generated with an err= or\n%!"; > tools/cmt2annot.ml: Printf.fprintf stderr "File was generated with an err= or\n%!"; > tools/dumpobj.ml: printf "File \"%s\", line %d, characters %d-%d:\n" ls.L= exing.pos_fname > tools/objinfo.ml: printf "File %s\n" filename; > tools/scrapelabels.ml: "Event"; "Filename"; "Format"; "Gc"; "Genlex"; "Gr= aphics"; > toplevel/opttopdirs.ml: | None -> fprintf ppf "File not found: %s@." name= 0; false > toplevel/topdirs.ml: fprintf ppf "File %s is not a bytecode object file.@= ." name; > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: unexpected end-of-fi= le\n", > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: syntax error\n", > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: unmatched /*\n", > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: unterminated string\= n", > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: unmatched %%{\n", > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: unterminated %%union= declaration\n", > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: too many %%union dec= larations\n", > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: illegal tag\n", > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: illegal character\n", > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: illegal use of reser= ved symbol \ > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: the start symbol `%s= ' cannot \ > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: warning: the type of= `%s' has been \ > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: warning: the precede= nce of `%s' has \ > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: warning: the value o= f `%s' has been \ > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: the entry point `%s'= is a \ > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: more than 256 entry = points\n", > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: no grammar has been = specified\n", > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: a token appears on t= he lhs \ > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: warning: conflicting= %%prec \ > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: unterminated action\= n", > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: warning: $%d referen= ces beyond the \ > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: illegal $-name\n", > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: $$ is untyped\n", > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: $%d (%s) is untyped\= n", > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: $%d is unbound\n", > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: $%d refers to termin= al `%s', \ > yacc/error.c: fprintf(stderr, "File \"%s\", line %d: no action specified = for this \ > > >