caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: Gabriel Scherer <gabriel.scherer@gmail.com>
Cc: William Smith <bills@emu-bark.com>, Caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] modified error messages for ocamlc
Date: Sun, 21 Apr 2013 11:53:51 +0100	[thread overview]
Message-ID: <D26E9844A5C74EF49FF69A3B2C075BAB@erratique.ch> (raw)
In-Reply-To: <CAPFanBG_A1MujHpwm-Tsx8X9WwV0261Yumv5kxekGPKCqBi_Zg@mail.gmail.com>



Le dimanche, 21 avril 2013 à 08:37, Gabriel Scherer a écrit :

> 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 things 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 mainly about the caml-error-regexp, caml-error-chars-regexp constants. Maybe, because of the standardization it's actually just a matter of removing the addition made to compilation-error-regexp-alist.  

Best,

Daniel

[1] http://caml.inria.fr/mantis/view.php?id=5899#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 = sprintf "File \"%s\", line %d, characters %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", FILENAME, 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" file) (Lexing.from_channel ic)
ocamlbuild/hygiene.ml: Some(sf "File %s in %s has suffix %s" name path suffix)
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, column 10: Lexing error: Only ',' separated tags are alllowed."];;
ocamldoc/odoc_messages.ml:let file_generated f = "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 = new Jg_menu.c "File" ~parent:menus
otherlibs/labltk/browser/editor.ml: ("File `" ^ name ^ "' exists. Overwrite it?")
otherlibs/labltk/browser/fileselect.ml: let dfrl = Label.create dfr ~text:"Files" in
otherlibs/labltk/browser/shell.ml: let file_menu = new Jg_menu.c "File" ~parent:menus
otherlibs/labltk/browser/viewer.ml: let filemenu = new Jg_menu.c "File" ~parent:menus
otherlibs/labltk/browser/viewer.ml: let filemenu = new Jg_menu.c "File" ~parent:menus
otherlibs/labltk/compiler/maincompile.ml: prerr_string "File \""; prerr_string !input_name;
otherlibs/labltk/examples_camltk/fileopen.ml:let t = Label.create cvs [Text "File name"];;
otherlibs/labltk/examples_camltk/winskel.ml: let file = Menubutton.create mbar [Text "File"; UnderlinedChar 0]
otherlibs/labltk/jpf/fileselect.ml: let dfrl = 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 "Filename.chop_extension"
stdlib/printexc.ml:let locfmt = 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 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.Lexing.pos_fname
tools/objinfo.ml: printf "File %s\n" filename;
tools/scrapelabels.ml: "Event"; "Filename"; "Format"; "Gc"; "Genlex"; "Graphics";
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 declaration\n",
yacc/error.c: fprintf(stderr, "File \"%s\", line %d: too many %%union declarations\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 reserved 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 precedence 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' 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 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 references 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 for this \




  reply	other threads:[~2013-04-21 10:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-18 16:40 William Smith
2013-04-21  7:37 ` Gabriel Scherer
2013-04-21 10:53   ` Daniel Bünzli [this message]
2013-04-21 11:28     ` Gabriel Scherer
  -- strict thread matches above, loose matches on Subject: below --
2013-04-14 15:20 William Smith
2013-04-14 16:25 ` Daniel Bünzli
2013-04-14 17:06   ` Gabriel Scherer
2013-04-14 17:57     ` Daniel Bünzli
2013-04-14 18:19       ` Jonathan Protzenko
2013-04-14 19:18         ` Daniel Bünzli
2013-04-15 15:37   ` Jacques Le Normand
2013-04-15  6:26 ` Raphaël Proust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D26E9844A5C74EF49FF69A3B2C075BAB@erratique.ch \
    --to=daniel.buenzli@erratique.ch \
    --cc=bills@emu-bark.com \
    --cc=caml-list@inria.fr \
    --cc=gabriel.scherer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).