Revision history for Parse-RecDescent 1.00 Mon Aug 11 13:17:13 1997 - original version 1.01 Mon Sep 8 18:04:14 EST 1997 - changed "quotemeta" to "quotemeta $_" in Text::Balanced to workaround bug in Perl 5.002 and 5.003 1.10 Tue Sep 30 14:51:49 EST 1997 - fixed fatal bug in tracing code - added m... format for regex tokens - added support for trailing modifiers (/.../gimsox) in regex tokens - added $thisline variable 1.20 Thu Oct 2 11:46:57 EST 1997 - fixed handling of trailing regex modifiers (now no whitespace allowed before between last delimiter and first modifier) - added trace diagnostic for failure/success of actions (demystifies failures caused by an action returning undef) - added context for "Matched rule..." trace - added a test so that an integer value (N>1) in the $::RD_TRACE variable now truncates (to N characters) all contexts reported in any trace - added "start-up" actions: actions appearing before the first rule were previously an error. They are now executed (once) at the start of the parser's namespace. 1.21 Sat Oct 4 17:12:23 EST 1997 - modified truncation of context in trace diagnostics (successful matches now report first N/2 and last N/2 chars, instead of first N) - fixed incorrect version number in Balanced.pm 1.22 Tue Oct 7 11:53:27 EST 1997 - fixed lurking trace problem with certain pathological regexes - fixed bug in generation of special namespaces (this was serious as it prevented the use of more than one alternation in a parser, as well as preventing the use of more than one parser in a script! 1.23 Fri Oct 17 10:15:22 EST 1997 - fixed error message generation for directives - fixed error message handling of empty productions - fixed handling of multi-line start-up actions - removed spurious debugging message for implicit subrule generation - changed naming scheme for alternations (pseudo-rule's name now describes location of alternation exactly) - added support for repetition specifiers on alternations. - Text::Balanced::extract_.... altered to honour the context in which they are called (see Balanced.pod for details). 1.24 - fixed minor problem in tracing code (context string now correctly reported for actions) - added explicit namespace declaration at beginning of generated code, to ensure that any "start code" is declared in the appropriate namespace. - fixed left recursion check on empty productions - added $::RD_AUTOSTUB flag and associated autostubbing behaviour (see new section - "Autostubbing" - in RecDescent.pod) - eliminated hierarchical precedence between $::RD_HINT and $::RD_TRACE. Enabling tracing now does _not_ automatically turn on hinting (although error and warning messages are still automatically enabled). - fixed bug in Text::Balanced. Division now correctly handled in code blocks. 1.25 Mon Feb 09 12:19:14 EST 1998 - Resynchronized numbering schemes for RecDescent and Balanced. 1.26 Wed Feb 25 13:52:15 EST 1998 - Fixed bug (and inefficiency) in directive. - Improved checking of regexes within grammars - Added subrule arguments (major change to internal grammar parser) - Added directive - started work on Compile() option (not complete yet - do not use!) - Made generated code "use strict" - Fixed bug which incorrectly warned against items following a directive. - Improved $thisline (added assignment and resync) - Fixed expectation messages for subrules - Rearranged tar file to co-operate with CPAN.pm 1.30 Fri May 22 05:52:06 1998 - Added directive - Added culling of productions starting with or - Cleaned up and improved format (and speed) of tracing code - Added warning levels - Optimized generation of token separator checking code. - Fixed bug encountered when parsing a literal string - Added $::RD_AUTOACTION to simplify standard actions at the end of each production 1.31 Fri May 22 06:11:26 1998 - Fixed bug in naming archive file 1.33 Fri May 22 06:15:26 1998 1.35 Wed Jun 24 09:57:02 1998 - Removed "foreach my $var ( @list )" constructs, which were biting users with perl 5.003 and earlier. - Fixed bug calling &Parse::RecDescent::toksepcode instead of &Parse::RecDescent::Rule::toksepcode - Changed grammar so that colons in rule definitions must appear on the same line as the rule name (as documented). Added an explicit error message when this is not the case. - Added $thiscolumn, which indicates the current column at any point in the parse. - Added $thisoffset, which indicates the absolute position in the original text string at any point in the parse. - Added $prevline and $prevcolumn, which indicate line and column of the last char of the last successfully matched item. - Added @itempos which provides: $itempos[$n]{offset}{from} $itempos[$n]{offset}{to} $itempos[$n]{line}{from} $itempos[$n]{line}{to} $itempos[$n]{column}{from} $itempos[$n]{column}{to} corresponding to each $item[$n]. See new documentation. - Several trivial lexical changes to make xemacs happy 1.41 Mon Aug 10 14:52:53 1998 - Enhanced POD in response to user feedback - Fixed subtle bug in Text::Balanced::extract_codeblock. It only bit when '(?)' appeared in implicit subrules - Added ability to pass args to the start-rule. 1.42 ???? - Added a test.pl - Modified behaviour of repetitions, so that the results of repeated subrules which succeed but don't consume are preserved (at least up to the minimal number of repetitions) - Fixed bug: @itempos now not incorrectly reset if grammar contained alternations - Fixed bug: Embedded unmatched '}' in regex tokens now works correctly - Miscellaneous tweaks to RecDescent.pod (e.g. updated meta-grammar) 1.43 Sat Aug 15 06:43:46 1998 - Resychronized Balanced.pm versions 1.50 Thu Aug 27 09:29:31 1998 - Changed parser to use extract_codeblock, so as to handle embedded '>' chars (e.g. {tmp}> ) - Added to allow deferred actions which are only executed if they are part of a rule that eventually succeeds. (see the new section under "Directives" in RecDescent.pod) - Fixed matching interpolated literals (was broken when literal contained pattern metacharacters) 1.51 Thu Aug 27 16:25:08 1998 - Maintenance release, rectifying bad soft links in the 1.50 distributions 1.60 Wed Oct 21 09:44:15 1998 [Never released] 1.61 Wed Oct 21 11:06:19 1998 - Added directive for supporting (future) token-stream parsing (see pod) - Added feature that data is consumed if passed as a reference (see pod) - Fixed bug in autogenerated errors: now ignores directives - Modified behaviour of directive so that deferred actions only executed if total parse succeeds (i.e. returns a defined value) - Made error messages "anti-deferred". That is, only those errors invoked in paths that eventually caused a parse to fail are printed - see documentation. - Miscellaneous fixes for Text::Balanced subroutines - Made private namespaces inherit Parse::RecDescent namespace (leads to more intuitive behaviour when calling methods of $thisparser) - *** NON-BACKWARDS COMPATIBLE CHANGE! *** Changed the behaviour of token separator specification. Now uses directive. See pod for new details. 1.62 Wed Dec 9 11:26:29 1998 - Reinstated missing $prevoffset variable - Corrected a possible bug with autoactions (thanks Mitchell) - *** IMPORTANT CHANGE *** $::RD_WARN now initialized 3 by default. Serious but non-fatal errors are automatically reported, unless you explicitly undefine $::RD_WARN. - Fixed bug in AUTOLOADing non-method subs defined in package Parse::RecDescent (thanks Mario) 1.63 Thu Mar 25 09:13:21 1999 - Rewrote documentation to replace the concept of a token separator with that of a token prefix. - Fixed obscure bug in replacement of rules containing implicit subrules (alternations). Thanks Craig. 1.64 Sun Mar 28 05:44:14 1999 - Synchronized with Text::Balanced version - Fixed obscure bug in the treatment of escaped backslashes in literal tokens. Thanks Matthew. 1.65 Wed May 19 12:35:05 1999 - Added and directives - Added level 2 warning and autoreject for lone directive in a production. 1.66 Fri Jul 2 13:35:06 1999 - Improved error message when an action fails to parse (Thanks Tuomas). - Allowed predefined subroutines in package Parse::RecDescent to be used as rules in grammars - Changed error report on bad regexes to level 3 warning, since compile-time interpolation failure may falsely invalidate regexes that would work at run-time. 1.70 Fri Oct 8 14:15:36 1999 - Clarified use of "eofile" idiom in POD file Clarified meaning of "free-form" in description of grammars Fixed examples, which were invalidated by earlier change in semantics of . (Thanks Knut). - Added grammar precompiler (see documentation) - Tweaked message for optimization. - Fixed bug when using '@' as a terminal (thanks Abigail) - Fixed nasty bug when $return set to zero - Added and directives (see documentation) 1.77 Mon Nov 22 06:11:32 1999 - IMPORTANT: Now requires 5.005 or better. - Added , , and directives (see documentation) - Added directive (see documentation) - Added %item hash (see documentation - thanks Stef!) - Tweaked internal parser in line with changes to Text::Balanced - Added directive to switch off recursion checking and other checks in stable grammars (see documentation). - Refined code generation WRT positional variables ($thisoffset, etc) - Added positional entries for %item (see documentation) - Fixed bug with (missing) start actions under precompiler (thanks Theo) 1.78 Mon Mar 20 12:03:17 2000 - Fixed error messages and documentation for Parse::RecDescent::Precompile (thanks Jim) - Moved demos to /demo subdirectory - Added tutorial in /tutorial subdirectory - Added directive - Added (s /sep/) notation (thanks Greg) - Circumvented \G and /gc calamities - Added more comprehensible error message when parser invoked through non-existent startrule (thanks Jeff) - Fixed serious bug with creating new parsers after existing ones had failed. (Thanks Paul) - Fixed problem with nested implicit subrules (thanks Marc). 1.79 Mon Aug 21 11:27:39 2000 - Pod tweak (thanks Abigail) - Documented need to use do{..} within some directives (thanks Paul) - Added Save method - Fixed bug that was preventing precompiled parsers being subsequently extended (thanks Jeff). - Changed keys used by %item. Now uses "named positionals" rather that simple positionals for non-subrule items (see documentation) - Added trimmer for surrounding whitespace in matchrules. - Squelched bug in (not) handling invalid directives (thanks John) 1.80 Sat Jan 20 05:02:35 2001 - Fixed Save so that saved parsers can still be used after saving (thanks Supun) - Fixed bug in line number tracking (thanks Theo) - Fixed bug in (s /pat/) shorthand (thanks Julien) - Improved docs on (thanks Steve) 1.90 Tue Mar 25 01:17:38 2003 - BACKWARDS INCOMPATIBLE CHANGE: The key of an %item entry for a repeated subrule now includes the repetition specifier. For example, in: sentence: subject verb word(s) the various matched items will be stored in $item{'subject'}, $item{'verb'}, and $item{'word(s)'} (i.e. *not* in $item{'word'}, as it would have been in previous versions of the module). (thanks Anthony) - Changed argument passing behaviour. If no arguments specified for subrule, it is now passed current rule's @arg instead. To get old (no arguments) behaviour use: subrule[] - Fixed bug in handling: failed to reject if $return had been set. (thanks Nick) - Added two useful demos of restructuring nested data (thanks Marc) - Fixed doc bug re use of // (thanks Randal) - Localized filehandles, like a good citizen should - Misc doc bug fixes (thanks all) - Fixed Text::Balance dependency in Makefile.PL (thanks Dominique) - Fixed bug that @itempos wasn't set up if referred to only in an autoaction. (thanks Eric) - Fixed truncation bug in tracing contexts - Dramatically improved speed of line counting (thanks John) - Made item(s) and item(s /,/) behave consistently wrt %item (thanks Marcel) - Added prototype handling - Added outer block markers for - Fixed multi-grammar precompilation (thanks Dominique) - Fixed numerous snafus in tutorial.html (thanks Ralph) - Added nesting level information to traces - Fixed resetting of $text after an rule. 1.91 Fri Mar 28 23:20:28 2003 - Updated Text::Balanced to fix various bugs 1.92 Wed Apr 2 04:45:37 2003 - Removed Text::Balanced from distribution (now a prereq only) 1.93 Wed Apr 2 22:25:14 2003 - Fixed fatal error with $tracelevel (thanks everyone) 1.94 Wed Apr 9 08:29:33 2003 - Replaced 'our' with 'use vars' to reinstate 5.005 compatibility. 1.95.1 Sun Sep 30 05:06:56 2007 - Updated README to reflect new status of Text::Balanced (i.e. required but not included in the distribution) - Fixed demo_logic (Thanks, Steve) - Fixed autopropagation of arguments into repetitions (Thanks, Luke) - Limited context info to 500 chars in traces (Thanks, Stephen) - Added option to select base namespace for autotreeing (thanks Gaal) - Improved formatting compatibility with 5.9.0 (thanks, David) - Added support for $::RD_HINT = 0 to turn off hinting entirely - Fixed bug in line handling - Returned $return variable to documented behaviour (i.e. setting return doesn't guarantee the match, only what is returned if the match succeeds) - Fixed nit in debugging of conditional regexes (thanks, Brian) - Moved expectation creation to compile-time (thanks François) - Removed redundant inheritances (i.e. @ISA elements) in internal namespace (thanks Hugo) - Added warning against C in actions to "GOTCHAS" documentation - Added demo_another_Cgrammar.pl (thanks Hendrik) - Documented parens (thanks Robin) - Removed incorrect meta-grammar from docs 1.96.0 Fri Oct 3 06:08:24 2008 - Propagated correct Changes file (thanks Matthew!) - Added: - 1.962.0 Tue Aug 25 19:45:15 2009 - Doc bug fix (thanks Christophe) - Fixed assymmetrical push/pop on @lines tracker (thanks Peter!) - Bumped sub-version number hugely to fix CPAN indexing (thanks Jerome) - Remove all occurrences of $& so we don't affect other regular expressions. - Perl 5.6.0 required for use of $+[0] and $-[0] for replacement of $&. 1.962.1 Thu Aug 27 21:39:30 2009 - Fixed subtle bug in leftop and rightop caused by removal of $& 1.963 Thu Jan 21 09:13:19 2010 - Fixed even subtler bug in leftop and rightop caused by removal of $& (Thanks Francesco) 1.964 Wed Feb 17 09:33:39 2010 - Fixed bug with undefined $1 when parsing literals (thanks Dan!) - Fixed premature namespace destruction bug with compiled grammars 1.964001 Tue Feb 23 15:15:18 2010 - Updated version number because versioning is a neverending nightmare in Perl 5 (thanks Matt) 1.965001 Sun Apr 4 15:00:10 2010 - Removed all references to /opts version of perl interpreter - Added Parse::RecDescent::redirect_reporting_to() to enable ERROR, TRACE, and TRACECONTEXT filehandles to be easily redirected. 1.966_000 Mon Jun 27 08:32:50 2011 - Patched unnamed subrules, so that they actual fail when not correctly specified (thanks Evgeniy!) - Added skip tests (thanks Flavio) - Added doc patch to make $skip semantics clearer (thanks Flavio!) - Fixed POD description of semantics (thanks Dirk!) 1.966_001 Mon Nov 14 10:34:52 2011 - Applied fix to restore skipped prefixes on match failure (thanks Jeremy!) - *** NON-BACKWARDS COMPATIBLE CHANGE! *** Removed formats to eliminate problems with filehandle duplication in forked environments. Removed redirect_reporting_to() in favor of using STDERR for all error/trace output. 1.966_002 Sun Jan 22 19:08:37 2012 - *** NON-BACKWARDS COMPATIBLE CHANGE! *** Change the caches for $prevline and $thisline to be local to the parser, rather than lexical vars in Parse::RecDescent. This prevents previously generated parsers from interfering with the line counts of later parsers. - removed trailing whitespace from all member files (cosmetic) - new tests, updated MANIFEST - Added Jeremy Braun as an author and current maintainer - update file permissions - fixed a few broken links in the pod 1.967001 Sat Jan 28 20:54:48 2012 - Addressed RT.cpan.org #28314: regex modifiers for tokens not honored during regex syntax check. (Thanks SADAHIRO!) - Fixed some POD typos - Added message on how to turn off "default" hint value in the default hint value ($::RD_HINT = 0). RT.cpan.org # #4898. - Modified _write_ERROR to call formline twice to avoid repeated $errorprefix. - Collected match tracing messages into a common function which takes into account positive/negative lookahead. - Addressed RT.cpan.org #74258: RD_AUTOSTUB does not work with precompiled parsers. (Thanks Yuri!) - Special-case $::RD_AUTOSTUB eq 1. $::RD_AUTOSTUB's value is ignored, and the unknown subrule 'rule' has a production "rule: 'rule'", rather than "rule: '1'". - Change Parse::RecDescent::new to call $self->Replace with only the grammar as an argument. That prevents the $compiling argument to new() from being incorrectly interpreted as $isimplicit. 1.967002 Sun Jan 29 19:13:04 2012 - Addressed RT.cpan.org #29966: regex with single backslash not recognized. Changed the definition of $TOKEN to handle backslashes inside of regex patterns. - Skip tests in t/reentry.t if Test::Warn isn't available. 1.967003 Mon Jan 30 07:24:53 2012 - Remove the 'use 5.10' from t/skip_dynamic.t, it runs fine against Perl 5.8.9. (Thanks Slaven!) 1.967_004 Tue Feb 7 22:11:11 2012 - Localize the OUT filehandle during Precompile. - Document the form of the directive. - Provide a simple test for the directive, t/autotree.t. Renamed basics.t to ensure it runs before autotree.t. - Allow a global directive that functions the same as modifying $Parse::RecDescent::skip prior to compiling a grammar. (Thanks Flavio!) - Require that the $file returned by caller() be eq '-', rather than merely starting with '-'. This allows execution of the following. (Thanks Christopher) perl -MParse::RecDescent -e 'print "$Parse::RecDescent::VERSION\n";' - Warn on empty productions followed by other productions. The empty production always matches, so following productions will never be reached. - *** NON-BACKWARDS COMPATIBLE CHANGE! *** A repetition directive such as 'id(s /,/)' correctly creates a temporary @item variable to hold the 'id's that are matched. That @item variable is them used to set the real $item[] entry for that repetition. The same treatment is now given to %item. Formerly, in a production like: id ',' id(s /,/) matched against: xxx, yyy, zzz The $item{id} entry which should be 'xxx' is overwritten by 'yyy' and then 'zzz' prior to the action being executed. Now 'yyy' and 'zzz' set $item{id}, but in the private %item, which goes out of scope once the repetition match completes. - ** EXPERIMENTAL ** When precompiling, optionally create a standalone parser by including most of the contents of Parse::RecDescent in the resulting Precompiled output. - Accept an optional $options hashref to Precompile, which can be used to specify $options->{-standalone}, which currently defaults to false. - The subroutines import, Precompile and Save are not included in the Precompile'd parser. - The included Parse::RecDescent module is renamed to Parse::RecDescent::_Runtime to avoid namespace conflicts with an installed and use'd Parse::RecDescent. - Add a new t/precompile.t to test precompilation. - Add a new $_FILENAME global to Parse::RecDescent to make it easy for the Precompile method to find the module. - Remove the prototype from _generate. It is not required, and it caused t/precompile.t (which ends up re-definiing a lot of Parse::RecDescent subroutines) to fail needlessly, as the calls to _generate in Replace and Extend normally do not see the prototype, but do when re-defined. - POD documentation for standalone parsers added. 1.967_005 Wed Feb 8 18:46:35 2012 - Added JTBRAUN@CPAN.org as author in Build.PL. - Added ExtUtils::MakeMaker build/configure version requirements. (RT.cpan.org #74787, Thanks POPEL!) 1.967006 Fri Feb 10 20:48:48 2012 - Bumped version to 1.967006 for non-development release. 1.967_007 Thu Feb 23 07:26:03 2012 - Revised ExtUtils::MakeMaker build/configure version requirements. (RT.cpan.org #74787, Thanks Paul!) - Revised Text::Balanced prereq to require version 1.95, necessary for t/skip.t to pass. (RT.cpan.org #74787, Thanks Paul!) - Removed unused version.pm prereq. - Fix a circular reference memory leak caused by the use of $AUTOLOAD in sub AUTOLOAD{} in the generated parser's namespace. Workaround documented in perl5 RT #110248. Workaround a circular reference memory leak in ISA documented by perl5 RT #92708. A parser's DESTROY() method redefines all subs before deleting the stash, to avoid circular references between subrules. (RT #53710, thanks Andreas!) - Parse::RecDescent::AUTOLOAD did not correctly handle initializing the line counting mechanism when a reference to a scalar was passed to the parser. (RT.cpan.org #27705, thanks Justin!) 1.967_008 Tue Mar 13 22:28:00 2012 - Restore old _parserepeat calling convention. Change a parser's DESTROY method to check for $self->{_not_precompiled} instead of $self->{_precompiled}. (Fix for RT #74593). 1.967009 Fri Mar 16 07:25:09 2012 - Bumped version to 1.967009 for non-development release. 1.967_010 Sun Jul 7 11:23:53 2013 - Base the standalone precompiled parser's runtime name on the parser's class, rather than use the fixed "Parse::RecDescent::_Runtime". This prevents "already defined" warnings when two standalone precompiled parsers are used. - Add support for allowing precompiled parsers to share a common runtime via the Precompile({-runtime_class}) option and the PrecompiledRuntime() function. - Warn on creation of Precompiled parsers that depend on Parse::RecDescent. - *** NON-BACKWARDS COMPATIBLE CHANGE! *** Change global the directive to eval similar to other directives, rather than being single-quoted in the resulting parser. 1.967011 Sat Sep 12 16:42:01 2015 - Correct some typos in the documentation. (RT.cpan.org #87185, thanks dsteinbrunner!) - Sort hash keys and rulenames when generating code. This keeps the output text for a given input text the same, reducing differences in automated builds. (RT.cpan.org #102160, thanks Reiner!) - Precompiled parsers now document which $Parse::RecDescent::VERSION was used to generate them. (RT.cpan.org #77001) 1.967012 Sun Sep 13 07:59:00 2015 - Reference Data::Dumper::Sortkeys, not SortKeys. Actually produces reproducible precompiled parsers now. (RT.cpan.org #107061, thanks Slaven!) 1.967013 Sun Sep 27 10:00:36 2015 - Wrap Data::Dumper->Dump() to localize some $Data::Dumper::VARS to control the dumped output. In particular, Data::Dumper::Terse=1 was reported to break parser generation. (RT.cpan.org #107355, thanks Sherrard!) 1.967014 Sat Apr 1 10:33:29 2017 - Add a newline to package declaration lines in precompiled parsers, to keep CPAN from indexing them. (RT.cpan.org #110404, thanks Martin!) - Provide repository and bugtracker entries in MYMETA.*. (RT.cpan.org #110403, thanks Martin!) - Update tests to handle '.' no longer being part of @INC in perl-5.26.0. (RT.cpan.org #120415, thanks Jim!) 1.967015 Tue Apr 4 07:38:07 2017 - Fix misuse of require to include MYMETA.pl, data is just included in both Makefile.PL and Build.PL nowB. (RT.cpan.org #120922, thanks Kent!)