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 \