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 \ > > >