r1041 - in packages/libdata-dumper-simple-perl/trunk: . debian lib/Data/Dumper t
Gunnar Wolf
gwolf@costa.debian.org
Wed, 25 May 2005 15:03:24 +0000
Author: gwolf
Date: 2005-05-25 15:03:24 +0000 (Wed, 25 May 2005)
New Revision: 1041
Added:
packages/libdata-dumper-simple-perl/trunk/t/40noparens.t
Modified:
packages/libdata-dumper-simple-perl/trunk/Changes
packages/libdata-dumper-simple-perl/trunk/MANIFEST
packages/libdata-dumper-simple-perl/trunk/META.yml
packages/libdata-dumper-simple-perl/trunk/debian/changelog
packages/libdata-dumper-simple-perl/trunk/lib/Data/Dumper/Simple.pm
Log:
new upstream version
Modified: packages/libdata-dumper-simple-perl/trunk/Changes
===================================================================
--- packages/libdata-dumper-simple-perl/trunk/Changes 2005-05-25 14:58:09 UTC (rev 1040)
+++ packages/libdata-dumper-simple-perl/trunk/Changes 2005-05-25 15:03:24 UTC (rev 1041)
@@ -1,12 +1,28 @@
Revision history for Perl extension Data::Dumper::Simple.
-0.01 Fri Jul 30 16:29:14 PDT 2004
- - original version; created by make_project 0.1
+0.07 Thu May 19 2005
+ - Implemented patch from Tom Phoenix that makes parentheses
+ optional (and a doc fix, too).
+ - Fixed little-known bug that triggered indirect method call
+ syntax. You can now do "diag Dumper($foo)" or
+ "diag Dumper $foo" if you wish.
-0.02 Sat Jul 31 12:30:00 PDT 2004
- - fixed tiny bug with how scalars were represented when
- a reference to one is taken.
+0.06 Monday Aug 2 2004
+ - Fixed variable with whitespace bug ($foo[ 4 ]).
+ Added autowarning.
+ Added ability to choose own name for &Dumper (helps with
+ namespace collisions).
+0.05 Sun Aug 01 2004
+ - taking a reference to an array or hash now lists the data
+ structure as a reference in the output. Shoulda done that
+ the first time.
+
+ Perl Barbie says "Source filtering is *hard*"
+
+0.04 Sun Aug 01 2004
+ - Commenting out a Dumper statement now works.
+
0.03 Sat Jul 31 15:30:00 PDT 2004
- Changed the filter from "code" to "executable". This
will sometimes mean that quoted data could be inappropriately
@@ -14,18 +30,9 @@
Filter::Simple. Still, this is a debugging module and it
should not really be an issue.
-0.04 Sun Aug 01 2004
- - Commenting out a Dumper statement now works.
+0.02 Sat Jul 31 12:30:00 PDT 2004
+ - fixed tiny bug with how scalars were represented when
+ a reference to one is taken.
-0.05 Sun Aug 01 2004
- - taking a reference to an array or hash now lists the data
- structure as a reference in the output. Shoulda done that
- the first time.
-
- Perl Barbie says "Source filtering is *hard*"
-
-0.06 Monday Aug 2 2004
- - Fixed variable with whitespace bug ($foo[ 4 ]).
- Added autowarning.
- Added ability to choose own name for &Dumper (helps with
- namespace collisions).
+0.01 Fri Jul 30 16:29:14 PDT 2004
+ - original version; created by make_project 0.1
Modified: packages/libdata-dumper-simple-perl/trunk/MANIFEST
===================================================================
--- packages/libdata-dumper-simple-perl/trunk/MANIFEST 2005-05-25 14:58:09 UTC (rev 1040)
+++ packages/libdata-dumper-simple-perl/trunk/MANIFEST 2005-05-25 15:03:24 UTC (rev 1041)
@@ -7,3 +7,4 @@
t/10dump.t
t/20import.t
t/30autowarn.t
+t/40noparens.t
Modified: packages/libdata-dumper-simple-perl/trunk/META.yml
===================================================================
--- packages/libdata-dumper-simple-perl/trunk/META.yml 2005-05-25 14:58:09 UTC (rev 1040)
+++ packages/libdata-dumper-simple-perl/trunk/META.yml 2005-05-25 15:03:24 UTC (rev 1041)
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Data-Dumper-Simple
-version: 0.06
+version: 0.07
version_from: lib/Data/Dumper/Simple.pm
installdirs: site
requires:
Modified: packages/libdata-dumper-simple-perl/trunk/debian/changelog
===================================================================
--- packages/libdata-dumper-simple-perl/trunk/debian/changelog 2005-05-25 14:58:09 UTC (rev 1040)
+++ packages/libdata-dumper-simple-perl/trunk/debian/changelog 2005-05-25 15:03:24 UTC (rev 1041)
@@ -1,3 +1,9 @@
+libdata-dumper-simple-perl (0.07-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Gunnar Wolf <gwolf@debian.org> Wed, 25 May 2005 09:57:55 -0500
+
libdata-dumper-simple-perl (0.06-1) unstable; urgency=low
* Initial Debian version (Closes: #287471)
Modified: packages/libdata-dumper-simple-perl/trunk/lib/Data/Dumper/Simple.pm
===================================================================
--- packages/libdata-dumper-simple-perl/trunk/lib/Data/Dumper/Simple.pm 2005-05-25 14:58:09 UTC (rev 1040)
+++ packages/libdata-dumper-simple-perl/trunk/lib/Data/Dumper/Simple.pm 2005-05-25 15:03:24 UTC (rev 1041)
@@ -1,13 +1,30 @@
package Data::Dumper::Simple;
-$REVISION = '$Id: Simple.pm,v 1.9 2004/08/03 04:48:09 ovid Exp $';
-$VERSION = '0.06';
+$REVISION = '$Id: Simple.pm,v 1.10 2005/05/20 01:37:08 ovid Exp $';
+$VERSION = '0.07';
use Filter::Simple;
use Data::Dumper ();
my $DUMPER_FUNCTION = 'Dumper';
my $AUTOWARN;
+my $COMMA = qr/(?:,|=>)/;
+my $ATOM = qr/(?!\d)[[:word:]]+/;
+my $SEP = qr/::/;
+my $NAME = qr/$SEP?$ATOM(?:$SEP$ATOM)*/;
+
+my $SCALAR = qr/\$$NAME/;
+my $ARRAY_ELEM = qr/\$$NAME\[[^]]+\]/;
+my $ARRAY = qr/\@$NAME/;
+my $HASH_ELEM = qr/\$$NAME\{[^}]+\}/;
+my $HASH = qr/\%$NAME/;
+
+my $VAR = qr/(?:$ARRAY|$HASH|$ARRAY_ELEM|$HASH_ELEM|$SCALAR)/;
+my $END_STMT = qr/(?=\s*[;}])/;
+
+my $ARG_LIST = qr/$VAR(?:\s*$COMMA\s*$VAR)*$END_STMT/;
+my $PAREN_LIST = qr/\([^)]+\)/;
+
sub import {
my ($class, @args) = @_;
@args = _validate_args(@args);
@@ -19,15 +36,17 @@
FILTER_ONLY
executable => sub { # not using code due to a possible bug in Filter::Simple
s{
- $DUMPER_FUNCTION\s*\(([^)]+)\)
+ $DUMPER_FUNCTION\s*($PAREN_LIST|$ARG_LIST)
}{
- my ($references, $names) = _munge_argument_list($1);
+ my $args = $1;
+ $args =~ s/^\((.*)\)$/$1/s; # strip parens, if any
+ my ($references, $names) = _munge_argument_list($args);
# keep it on a single line so users can comment it out
my $output = "Data::Dumper->Dump( [$references], [qw/$names/] )";
if ($AUTOWARN) {
$output = "$AUTOWARN($output)";
}
- $output
+ "($output)"; # parens prevent accidental indirect method syntax
}gex
};
@@ -91,6 +110,7 @@
use Data::Dumper::Simple;
warn Dumper($scalar, @array, %hash);
warn Dumper($scalar, \@array, \%hash);
+ warn Dumper $scalar, @array, %hash;
=head1 ABSTRACT
@@ -294,10 +314,22 @@
some items being dumped. I've fixed that, but made the module a wee bit less
robust. This will hopefully be fixed in the next release of Text::Balanced.
-=item * The parentheses are mandatory.
+=item * Line numbers may be wrong
-Sorry 'bout that.
+Because this module uses a source filter, line numbers reported from
+syntax or other errors may be thrown off a little.
+This is probably a bug in the source filter implementation, which should
+use C<#line> directives. As a workaround until this is fixed, put a
+directive (such as C<#line 10000>) a few lines ahead of the suspected
+bug. If the error is reported as happening in line 10007, you know to
+look about eight lines below your directive for the bug. Be sure to
+remove the bogus directive once you find the bug!
+
+=item * The parentheses are optional, but the syntax isn't bulletproof
+
+If you try, it's not hard to confuse the parser. Patches welcome.
+
=back
Note that this is not a drop-in replacement for C<Data::Dumper>. If you
Copied: packages/libdata-dumper-simple-perl/trunk/t/40noparens.t (from rev 1040, packages/libdata-dumper-simple-perl/branches/upstream/current/t/40noparens.t)