r51339 - in /branches/upstream/libparse-recdescent-perl/current: Changes MANIFEST META.yml README demo/demo.pl lib/Parse/RecDescent.pm t/leftop_cap.t
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Fri Jan 22 18:05:57 UTC 2010
Author: jawnsy-guest
Date: Fri Jan 22 18:05:40 2010
New Revision: 51339
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=51339
Log:
[svn-upgrade] Integrating new upstream version, libparse-recdescent-perl (1.963+dfsg)
Added:
branches/upstream/libparse-recdescent-perl/current/t/leftop_cap.t
Modified:
branches/upstream/libparse-recdescent-perl/current/Changes
branches/upstream/libparse-recdescent-perl/current/MANIFEST
branches/upstream/libparse-recdescent-perl/current/META.yml
branches/upstream/libparse-recdescent-perl/current/README
branches/upstream/libparse-recdescent-perl/current/demo/demo.pl
branches/upstream/libparse-recdescent-perl/current/lib/Parse/RecDescent.pm
Modified: branches/upstream/libparse-recdescent-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-recdescent-perl/current/Changes?rev=51339&op=diff
==============================================================================
--- branches/upstream/libparse-recdescent-perl/current/Changes (original)
+++ branches/upstream/libparse-recdescent-perl/current/Changes Fri Jan 22 18:05:40 2010
@@ -573,5 +573,7 @@
- Fixed subtle bug in leftop and rightop caused by removal of $&
-1.962.2 Fri Aug 28 13:39:33 2009
-
+1.963 Thu Jan 21 09:13:19 2010
+
+ - Fixed even subtler bug in leftop and rightop caused by removal of $&
+ (Thanks Francesco)
Modified: branches/upstream/libparse-recdescent-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-recdescent-perl/current/MANIFEST?rev=51339&op=diff
==============================================================================
--- branches/upstream/libparse-recdescent-perl/current/MANIFEST (original)
+++ branches/upstream/libparse-recdescent-perl/current/MANIFEST Fri Jan 22 18:05:40 2010
@@ -75,3 +75,4 @@
t/basics.t
t/re_capture_return.t
t/separated_repetition.t
+t/leftop_cap.t
Modified: branches/upstream/libparse-recdescent-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-recdescent-perl/current/META.yml?rev=51339&op=diff
==============================================================================
--- branches/upstream/libparse-recdescent-perl/current/META.yml (original)
+++ branches/upstream/libparse-recdescent-perl/current/META.yml Fri Jan 22 18:05:40 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Parse-RecDescent
-version: 1.962.2
+version: 1.963
abstract: Generate Recursive-Descent Parsers
license: ~
author:
Modified: branches/upstream/libparse-recdescent-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-recdescent-perl/current/README?rev=51339&op=diff
==============================================================================
--- branches/upstream/libparse-recdescent-perl/current/README (original)
+++ branches/upstream/libparse-recdescent-perl/current/README Fri Jan 22 18:05:40 2010
@@ -1,4 +1,4 @@
-Parse::RecDescent version 1.962.2
+Parse::RecDescent version 1.963
NAME
Modified: branches/upstream/libparse-recdescent-perl/current/demo/demo.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-recdescent-perl/current/demo/demo.pl?rev=51339&op=diff
==============================================================================
--- branches/upstream/libparse-recdescent-perl/current/demo/demo.pl (original)
+++ branches/upstream/libparse-recdescent-perl/current/demo/demo.pl Fri Jan 22 18:05:40 2010
@@ -1,4 +1,4 @@
-#! /usr/local/bin/perl -sw
+#! /usr/bin/perl -w
package Foo;
use base Parse::RecDescent;
@@ -8,6 +8,7 @@
}
package main;
+
$parse = new Parse::RecDescent(<<'EOG');
input : "cat"
Modified: branches/upstream/libparse-recdescent-perl/current/lib/Parse/RecDescent.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-recdescent-perl/current/lib/Parse/RecDescent.pm?rev=51339&op=diff
==============================================================================
--- branches/upstream/libparse-recdescent-perl/current/lib/Parse/RecDescent.pm (original)
+++ branches/upstream/libparse-recdescent-perl/current/lib/Parse/RecDescent.pm Fri Jan 22 18:05:40 2010
@@ -1594,7 +1594,7 @@
' . $op->code(@_[1..2]) . '
' . ($op->isterminal() ? 'pop @item;' : '$backtrack=1;' ) . '
' . (ref($op) eq 'Parse::RecDescent::Token'
- ? 'if (defined $2) {push @item, $item{'.($self->{name}||$self->{hashname}).'}=$2; $backtrack=1;}'
+ ? 'if (defined $1) {push @item, $item{'.($self->{name}||$self->{hashname}).'}=$1; $backtrack=1;}'
: "" ) . '
' . $rightarg->code(@_[1..2]) . '
$savetext = $text;
@@ -1620,7 +1620,7 @@
' . $op->code(@_[1..2]) . '
$savetext = $text;
' . ($op->isterminal() ? 'pop @item;' : "" ) . '
- ' . (ref($op) eq 'Parse::RecDescent::Token' ? 'do { push @item, $item{'.($self->{name}||$self->{hashname}).'}=$2; } if defined $2;' : "" ) . '
+ ' . (ref($op) eq 'Parse::RecDescent::Token' ? 'do { push @item, $item{'.($self->{name}||$self->{hashname}).'}=$1; } if defined $1;' : "" ) . '
}
$text = $savetext;
pop @item if $backtrack;
@@ -1723,7 +1723,7 @@
my $ERRORS = 0;
-use version; our $VERSION = qv('1.962.2');
+our $VERSION = '1.963';
# BUILDING A PARSER
@@ -1772,7 +1772,12 @@
die "Compilation of Parse::RecDescent grammars not yet implemented\n";
}
-sub DESTROY {} # SO AUTOLOADER IGNORES IT
+sub DESTROY {
+ my ($self) = @_;
+ my $namespace = $self->{namespace};
+ $namespace =~ s/Parse::RecDescent:://;
+ delete $Parse::RecDescent::{$namespace.'::'};
+}
# BUILDING A GRAMMAR....
@@ -3120,7 +3125,7 @@
=head1 VERSION
-This document describes version 1.94 of Parse::RecDescent,
+This document describes version 1.963 of Parse::RecDescent
released April 9, 2003.
=head1 SYNOPSIS
Added: branches/upstream/libparse-recdescent-perl/current/t/leftop_cap.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-recdescent-perl/current/t/leftop_cap.t?rev=51339&op=file
==============================================================================
--- branches/upstream/libparse-recdescent-perl/current/t/leftop_cap.t (added)
+++ branches/upstream/libparse-recdescent-perl/current/t/leftop_cap.t Fri Jan 22 18:05:40 2010
@@ -1,0 +1,22 @@
+use Parse::RecDescent;
+
+my $grammar = q {
+ nolcap : <leftop: id /\+|-/ id>
+ lcap : <leftop: id /(\+|-)/ id>
+
+ norcap : <rightop: id /\+|-/ id>
+ rcap : <rightop: id /(\+|-)/ id>
+
+ id : /[a-zA-Z][a-zA-Z_0-9\.]*/
+};
+
+my $parser = new Parse::RecDescent($grammar) or die "Bad Grammar";
+
+use Test::More tests=>4;
+
+my $text = "a + b - c + d";
+
+is_deeply $parser->nolcap($text), [qw<a b c d>] => 'Capturing leftop';
+is_deeply $parser->lcap($text), [qw<a + b - c + d>] => 'Noncapturing leftop';
+is_deeply $parser->norcap($text), [qw<a b c d>] => 'Capturing rightop';
+is_deeply $parser->rcap($text), [qw<a + b - c + d>] => 'Noncapturing rightop';
More information about the Pkg-perl-cvs-commits
mailing list