summaryrefslogtreecommitdiff
path: root/lib/diagnostics.pm
Commit message (Collapse)AuthorAgeFilesLines
* Expand tabs in diagnostics.pmFather Chrysostomos2014-02-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise pod like this: The second situation is caused by an eval accessing a lexical subroutine that has gone out of scope, for example, sub f { my sub a {...} sub { eval '\&a' } } f()->(); is turned into this: The second situation is caused by an eval accessing a variable that has gone out of scope, for example, sub f { my $a; sub { eval '$a' } } f()->(); instead of this: The second situation is caused by an eval accessing a variable that has gone out of scope, for example, sub f { my $a; sub { eval '$a' } } f()->(); I don’t know how to test this without literally copying and pasting parts of diagnostics.pm into diagnostics.t. But I have tested it man- ually and it works.
* diagnostics.pm: Eliminate $WHOAMIFather Chrysostomos2014-02-081-5/+6
| | | | | | | | This variable only held the package name. __PACKAGE__ is faster, as it allows constant folding. diagnostics.pm just happens to be older than __PACKAGE__, which was introduced as recently as 1997 (68dc074516).
* Increase $diagnostics::VERSION to 1.34Father Chrysostomos2014-02-081-1/+1
|
* RT-119817 - Treat =back as the end of a warning description.Matthew Horsfall (alh)2013-09-171-2/+8
| | | | | This keeps any trailing data in the file from showing up as part of the last warning's description.
* Increase $diagnostics::VERSION to 1.32Father Chrysostomos2013-08-121-1/+1
|
* diagnostics: don’t truncate wrapped linksFather Chrysostomos2013-08-121-1/+1
|
* Increase $diagnostics::VERSION to 1.31Father Chrysostomos2012-12-221-1/+1
|
* RT-89642 - Don't treat ,; as special end-of-line characters.Matthew Horsfall (alh)2012-12-221-11/+12
| | | | | | Support multi-line "=item ..." expressions per the POD spec. This also allows warnings with white-space differences to match.
* Revert "Increase $diagnostics::VERSION to 1.31"Father Chrysostomos2012-07-291-1/+1
| | | | | | | This reverts commit c369a25dcc5e5c5b627a50d1c4b73c2be0b926b9. I have just reverted the only other change to diagnostics.pm since 5.17.2.
* Revert "Use $^S instead of caller in splain"Father Chrysostomos2012-07-291-1/+8
| | | | | | | | This reverts commit 019070c31184a4deb57cb85f7e597a789c6c5b54. I misunderstood $^S, and thought I could simplify the code. Contrary to what perlvar says, $^S is undefined not only during compilation of an eval or module, but also during compilation of the main program.
* Use $^S instead of caller in splainFather Chrysostomos2012-07-291-8/+1
|
* Increase $diagnostics::VERSION to 1.31Father Chrysostomos2012-07-291-1/+1
|
* Teach diagnostics.pm about %pFather Chrysostomos2012-06-291-3/+3
|
* Increase $diagnostics::VERSION to 1.30Father Chrysostomos2012-06-291-1/+1
|
* Deprecate literal unescaped "{" in regexes.Karl Williamson2012-05-241-3/+3
| | | | | | | | | | | | | | | | | We are deprecating literal left braces in regular expressions. The 5.16 delta announced that this is coming. This commit causes a warning to be raised when a literal "{" is encountered. However, it does not do this if the left brace is at the beginning of a construct. Such a brace does not cause problems for us for our future use of it for other purposes, as, for example in things like \b{w}, and there were a large number of core tests that failed without this condition. I didn't mention this exception in the diagnostic. We may choose to forbid it everywhere, and we certainly want to discourage its use everywhere. But this commit gets the essential components in early in 5.17, and we can tighten it up later if we decide to.
* Remove use of study from splainFather Chrysostomos2012-01-311-1/+0
| | | | | It only helps with very long strings. It actually slows things down slightly when used on short strings.
* diagnostics doesn't need to search for perldelta.pod in pre-5.005 locations.Nicholas Clark2012-01-311-7/+2
| | | | | | | | | | | | | | | | | | | Pods are installed into privlib. Before Perl 5.005, privlib didn't contain the version number in it, so 5.004 and 5.003 (etc) both installed to the same directory. perldiag.pod differed in not-quite compatible ways, so hacks were put in to (a) also install it in privlib with the version number in the filename (b) to hard link it to archlib, which always did contain the version number. 5.005 changed privlib to contain the version number, solving the underlying problem (strictly commit bfb7748a896459cc, described here: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1998-07/msg00136.html ) Commit a841533b5cf319b3 (Oct 2009) removed the first installation hack, Commit e8ea61279d90dbe9 (Jul 1998) removed the second. Hence the code to search in the "hacked" locations is no longer needed, and in the interests of clarity, should go.
* Fix up diagnostic.pm’s backtrace for multiline msgsFather Chrysostomos2011-12-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I hope you agree this backtrace does not look very good: $ ./perl -Ilib -Mdiagnostics -e ' sub foo { bar () } sub bar { baz() } sub baz { die "Attempt to reload foo aborted.\nCompilation failed in require"} foo ' Attempt to reload foo aborted (#1) (F) You tried to load a file with use or require that failed to compile once already. Perl will not try to compile this file again unless you delete its entry from %INC. See "require" in perlfunc and "%INC" in perlvar. Compilation failed in require at -e line 1 (#2) (F) Perl could not compile a file specified in a require statement. Perl uses this generic message when none of the errors that it encountered were severe enough to halt compilation immediately. Uncaught exception from user code: Attempt to reload foo aborted. Compilation failed in require at -e line 1. main::baz() called at -e line 1 main::bar() called at -e line 1 main::foo() called at -e line 1
* Add support for multiline messages to splainFather Chrysostomos2011-12-261-6/+16
| | | | | | | | | | | | | | All the ‘Compilation failed’ messages are actually multiline mes- sages, like "Attempt to reload foo aborted.\nCompilation failed in require at ...". perldiag has separate entries for each line of the message, so it makes sense to have it look up each line. It can’t split it into lines by default, but must check for a possible description first, as sometimes syntax errors quote code with line breaks in it. I had to rip out the nasty file-wide lexical $_, as I couldn’t local- ise it, and I undid d923656e4 in the process.
* Remove unnecessary code from diagnostics.pmFather Chrysostomos2011-12-261-3/+0
| | | | | As of commit 58618f23, it has been setting %CarpInternal, so setting $CarpLevel is unnecessary.
* Fix diagnostic.pm’s backtracesFather Chrysostomos2011-12-261-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently a user-defined error message is printed out like this: ----- Uncaught exception from user code: panick: at -e line 1. at -e line 1 main::baz() called at -e line 1 main::bar() called at -e line 1 main::foo() called at -e line 1 ----- Errors generated from perl itself are printed like this: ----- panic: at -e line 1 (#1) (P) An internal error. Uncaught exception from user code: panic: at -e line 1. at -e line 1 main::baz() called at -e line 1 main::bar() called at -e line 1 main::foo() called at -e line 1 ----- By using Carp::confess(), we end up with a screwy backtrace. Some- times it just ends up repeating the error and line number: ----- panic: at -e line 1 (#1) (P) An internal error. Uncaught exception from user code: panic: at -e line 1. at -e line 1 ----- Uncaught exception from user code: panick at -e line 1. at -e line 1 ----- This commit cleans these up to print like this: ----- Uncaught exception from user code: panick: at -e line 1. main::baz() called at -e line 1 main::bar() called at -e line 1 main::foo() called at -e line 1 ----- panic: at -e line 1 (#1) (P) An internal error. Uncaught exception from user code: panic: at -e line 1. main::baz() called at -e line 1 main::bar() called at -e line 1 main::foo() called at -e line 1 ----- panic: at -e line 1 (#1) (P) An internal error. Uncaught exception from user code: panic: at -e line 1. ----- Uncaught exception from user code: panick at -e line 1. ----- You might ask: Why not remove the ‘uncaught exception’ message alto- gether after an error description. It’s because the error description is a diagnostic, which only prints once for each error or warning encountered. So you could have eval { die } somewhere else in the code, which causes a description to be printed. And later you have a die() that exits the program, but nothing gets printed. In other words, the description of the message does not replace the error.
* Consistent use of spaces after dots in diagnostics.pmFather Chrysostomos2011-12-261-3/+4
|
* Increase $diagnostics::VERSION to 1.27Father Chrysostomos2011-12-261-1/+1
|
* Increase $diagnostics::VERSION to 1.26Father Chrysostomos2011-12-161-1/+1
|
* Teach splain about %XFather Chrysostomos2011-12-161-3/+3
|
* Strip S<> formatting codes from diagnostics outputMatthew Horsfall (alh)2011-08-221-1/+7
| | | | | | Update spacing Don't break S<20 questions> across lines, update test to be accurate
* Increase $diagnostics::VERSION from 1.23 to 1.24Father Chrysostomos2011-08-021-1/+1
|
* RT #94988 - Support for %u in diagnostics.pm's printf()-format parserMatthew Horsfall (alh)2011-08-021-4/+4
|
* Increase $diagnostics::VERSIONFather Chrysostomos2011-07-081-1/+1
|
* Allow items in perldiag.pod to match warnings when they have periods at the endMatthew Horsfall2011-07-081-0/+3
|
* Make diagnostics.pm understand messages sharing descriptionsFather Chrysostomos2011-02-121-0/+15
| | | | | | | | | | | | | | | We currently have entries in perldiag like this: =item Code point 0x%X is not Unicode, may not be portable =item Code point 0x%X is not Unicode, no properties match it; all inverse properties do (W utf8) You had a code point above the Unicode maximum of U+10FFFF. ... diagnostics.pm needs to know that the description applies to the first =item, as well as to the second.
* Improve diagnostics.pm’s link rendering.Father Chrysostomos2011-02-121-3/+24
| | | | | | | | | | | | | | | | | | The number of L<foo/bar> links in perldiag has grown over time, and diagnostics.pm has never been updated to render them nicely, resulting in output like this: Lexing code attempted to stuff non-Latin-1 character into Latin-1 input at lib/diagnostics.t line 36 (#3) (F) An extension is attempting to insert text into the current parse (using lex_stuff_pvn_flags|perlapi/lex_stuff_pvn_flags or similar), but tried to insert a character that couldn't be part of the current input. This is an inherent pitfall of the stuffing mechanism, and one of the reasons to avoid it. Where it is necessary to stuff, stuffing only plain ASCII is recommended. I’ve implemented some rudimentary L<> parsing, which should suffice for perldiag. I think using a real POD processor would be overkill.
* Version bumps for non-dual-life pragmas identified byJesse Vincent2011-01-201-1/+1
| | | | ./perl -Ilib Porting/cmpVERSION.pl -xd . v5.13.8
* Fix typos (spelling errors) in lib/*Peter J. Acklam) (via RT2011-01-071-1/+1
| | | | | | | | | # New Ticket Created by (Peter J. Acklam) # Please include the string: [perl #81890] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81890 > Signed-off-by: Abigail <abigail@abigail.be>
* Remove MacOS classic support from blib, diagnostics and Term::ReadLine.Nicholas Clark2010-06-231-7/+1
| | | | | ExtUtils::MakeMaker removed MacOS support in 6.25, merged to blead in December 2004, so this code is vestigial, and a small runtime penalty.
* [perl #71204] diagnostics.pm suppresses 'Use of uninitialized value in range ↵Gene Sullivan2009-12-141-1/+2
| | | | | | (or flip)' warning (and bump version of diagnostics.pm)
* [perl #70337] perldiag: localtime(...) too largeFather Chrysostomos2009-11-131-3/+3
| | | | | | | | | The message ‘localtime(...) too large’ is not documented in perldiag. The attached patch adds it. I know it’s technically ‘%s(%.0f) too large’, but it’s easier for users to find it under ‘localtime’ and ‘gmtime’. I also had to modify diagnostics.pm to support %.0f, and I added a test, but I used a hack with STDERR that would make debugging very difficult to anyone else adding tests.
* Some source files and documentation files need not to be executableRafael Garcia-Suarez2008-12-251-0/+0
|
* Patch by Abigail to avoid using $& in diagnostics.pm.Rafael Garcia-Suarez2007-03-151-1/+1
| | | p4raw-id: //depot/perl@30601
* Localize $! in splainthis() too. (see bug #41717)Rafael Garcia-Suarez2007-03-071-0/+1
| | | p4raw-id: //depot/perl@30492
* Better localisation of $_ in diagnostics.Rafael Garcia-Suarez2007-03-071-5/+4
| | | | | This fixes bug #41717. p4raw-id: //depot/perl@30491
* [perl #39141] lots of warnings with diagnostics and (warn or die)Dave Mitchell2006-05-191-0/+1
| | | | | | stop C<use diagnostics; warn "\n"> outputing lots of 'uninit' warnings. p4raw-id: //depot/perl@28231
* Re: [perl #39152] diagnostics.pm: "-traceonly" vs "-trace"Fergal Daly2006-05-181-4/+4
| | | | | | From: "Fergal Daly" <fergal@esatclear.ie> Message-ID: <875029960605171059y286fe449nd39d6830ef2b229a@mail.gmail.com> p4raw-id: //depot/perl@28224
* Bump $VERSION in many modules that have changed.Nicholas Clark2006-01-121-1/+1
| | | p4raw-id: //depot/perl@26804
* Typos in *.p[lm]Piotr Fusik2005-08-021-1/+1
| | | | | | From: "Piotr Fusik" <pfusik@op.pl> Message-ID: <001401c595bd$dccb5d80$0bd34dd5@piec> p4raw-id: //depot/perl@25261
* [perl #30227] [PATCH]splain vs. -w Steve Peters2004-10-251-1/+2
| | | | | | From: "Steve Peters via RT" <perlbug-followup@perl.org> Message-ID: <rt-3.0.11-30227-98375.1.28465791111211@perl.org> p4raw-id: //depot/perl@23422
* extension to diagnostics.pmFergal Daly2004-08-041-5/+36
| | | | | Message-ID: <20040803233309.GA239@dyn.fergaldaly.com> p4raw-id: //depot/perl@23191
* Bump version numbersNicholas Clark2004-07-011-1/+1
| | | p4raw-id: //depot/perl@23019
* correctly handle C<< >> and C<<< >>> in diagnosticsYitzchak Scott-Thoennes2004-05-261-2/+2
| | | | | Message-ID: <20040525092937.GA2332@efn.org> p4raw-id: //depot/perl@22848
* Bump VERSION numbersNicholas Clark2003-12-301-1/+1
| | | p4raw-id: //depot/perl@22018