Commit Graph

27 Commits (master)

Author SHA1 Message Date
alainfrisch 0d968e357b Move variable printer to Pprintast
- The code responsible for printing Syntaxerr errors is moved to the
  Parse module (so that it can depend on the variable printer in
  Pprintast).

- Pprintast becomes a dependency for a few tools that link some
  compiler modules in an ad hoc way (they would better be implemented
  in terms of compiler-libs).
2018-11-06 13:12:54 +01:00
alainfrisch 74b24580ca Fix printing of type variables with a quote on 2nd character
Type variables whose name has a single quote as the second character
(such as ' a' or ' a'b) need to be printed with a whitespace after the
initial quote symbol, in order not to be confused with a character
literal.
2018-11-06 13:12:54 +01:00
Armaël Guéneau c0820e30cb Location: significantly rework the code printing errors and warnings 2018-08-08 17:42:08 +02:00
Simon Cruanes 9e21876a28 PR#7147: add colors to errors generated by ppx rewriters
The default error printer now adds the maybe colored "Error" prefixed
itself.

None of the convenience functions (`Location.errorf`,
`Location.error_of_printer`, ...) insert the "Error" prefix
anymore. To handle the formatting correctly, a phantom prefix is added
using `Format.pp_print_as`.

Updated the testsuite.
2016-07-11 16:37:32 +01:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
alainfrisch e1e03820e5 Fix #7097: improve syntax errors for illegal package types
The current fix is to rely on the parsing rules for generic module types, and then
extract a package type, enabling more explicit error messages.  Alternatively, one
could keep the generic module type in the Parsetree and extract the package type
at type-checking time.  But I don't feel like touching the Parsetree definition so
close from a release, consider the impact on Camlp4/5, PPX mappers and other
syntactic tools.
2016-01-05 13:10:25 +01:00
Gabriel Scherer c508c47101 colorize error and warning messages, refactor Location
(Simon Cruanes)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16349 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 15:57:53 +00:00
Damien Doligez cbfe627f92 merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22 13:45:02 +00:00
Alain Frisch 481ee603df Remove spurious character from error message.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14492 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-26 08:46:12 +00:00
Alain Frisch 6ad98b3d09 Port Syntaxerr.Error to the new system. Trickier, because of special way to report some errors in the toplevel (is it really worth the trouble?).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14105 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-11 18:10:59 +00:00
Alain Frisch 92ad47d47b Keep item attributes on let-binding structure items.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13511 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-11 13:52:06 +00:00
Alain Frisch 238814e293 #5770: Syntax error messages involving unclosed parens are sometimes incorrect.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13019 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-16 14:04:33 +00:00
Damien Doligez def31744f9 remove all $Id keywords
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-15 17:50:56 +00:00
Jacques Garrigue b3e0f2e72a Fix PR#5553: do not allow a type variable to have the same name as a local type
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12257 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-03-23 02:20:24 +00:00
Pierre Weis 731b2a05dd Too long lines.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11254 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-10-28 21:26:01 +00:00
Damien Doligez d9eb848d86 PR#5238, PR#5277: Sys_error when getting error location
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11166 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-08-04 14:59:13 +00:00
Damien Doligez 3b507dd1aa renaming of Objective Caml to OCaml and cleanup of copyright headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-27 14:17:02 +00:00
Xavier Leroy 11217e8f70 Added option -no-app-funct to turn off applicative functors
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9316 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2009-07-15 14:06:37 +00:00
Damien Doligez e9a9bf9613 PR#3114 make all error messages start with a location and "Error: "
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8705 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2007-12-04 13:38:58 +00:00
Jacques Garrigue 59d5d16cf3 affiche numeros de caracteres ET soulignement pour dumb
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4698 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-04-18 08:50:43 +00:00
Jacques Garrigue 80fcfd9313 Passe bien a la ligne
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3064 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2000-04-12 09:54:53 +00:00
Pierre Weis b96208b7a2 Revu les impressions du compilateur
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2908 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2000-03-06 22:12:09 +00:00
Pierre Weis 39553e9972 Révision de l'impression à l'aide de format: utilisation de printf
pour condenser les programmes et aussi préparer une future (éventuelle)
internationalisation d'Objective Caml.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2796 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2000-02-08 20:00:06 +00:00
Xavier Leroy cc0f32b054 Changement de la licence
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2553 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-11-17 18:59:06 +00:00
Xavier Leroy a048d42b10 Ajout du module Formatmsg pour rediriger les messages du systeme vers stdout ou stderr suivant le contexte
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2486 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-11-08 17:06:33 +00:00
Xavier Leroy 915299517e Revu les erreurs de syntaxe sur les parentheses pas fermees, etc
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1760 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1997-11-12 12:32:53 +00:00
Xavier Leroy 579e1523e9 Meilleures erreurs de syntaxe pour les parentheses mal fermees, etc
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1689 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1997-08-22 08:55:41 +00:00