[tapx-dev] [commit][176] Tidied
andy at hexten.net
andy at hexten.net
Thu Jul 12 23:40:46 BST 2007
Revision: 176
Author: andy
Date: 2007-07-12 23:40:45 +0100 (Thu, 12 Jul 2007)
Log Message:
-----------
Tidied
Modified Paths:
--------------
trunk/lib/TAP/Parser/Grammar.pm
Modified: trunk/lib/TAP/Parser/Grammar.pm
===================================================================
--- trunk/lib/TAP/Parser/Grammar.pm 2007-07-12 22:38:55 UTC (rev 175)
+++ trunk/lib/TAP/Parser/Grammar.pm 2007-07-12 22:40:45 UTC (rev 176)
@@ -52,7 +52,7 @@
sub new {
my ( $class, $stream ) = @_;
my $self = bless { stream => $stream }, $class;
- $self->set_version(12);
+ $self->set_version( 12 );
return $self;
}
@@ -83,10 +83,7 @@
my ( $self, $line ) = @_;
local *__ANON__ = '__ANON__version_token_handler';
my $version = $1;
- return $self->_make_version_token(
- $line,
- $version,
- );
+ return $self->_make_version_token( $line, $version, );
}
},
plan => {
@@ -96,16 +93,13 @@
local *__ANON__ = '__ANON__plan_token_handler';
my $tests_planned = $1;
my $explanation = $2;
- my $skip =
- ( 0 == $tests_planned || defined $explanation )
+ my $skip
+ = ( 0 == $tests_planned || defined $explanation )
? 'SKIP'
: '';
$explanation = '' unless defined $explanation;
- return $self->_make_plan_token(
- $line,
- $tests_planned,
- $skip,
- _trim($explanation),
+ return $self->_make_plan_token( $line, $tests_planned, $skip,
+ _trim( $explanation ),
);
},
},
@@ -123,14 +117,8 @@
local *__ANON__ = '__ANON__test_token_handler';
my ( $ok, $num, $desc, $dir, $explanation )
= ( $1, $2, $3, $4, $5 );
- return $self->_make_test_token(
- $line,
- $ok,
- $num,
- $desc,
- uc $dir,
- $explanation
- );
+ return $self->_make_test_token( $line, $ok, $num, $desc, uc $dir,
+ $explanation );
},
},
comment => {
@@ -148,10 +136,7 @@
my ( $self, $line ) = @_;
local *__ANON__ = '__ANON__bailout_token_handler';
my $explanation = $1;
- return $self->_make_bailout_token(
- $line,
- _trim($explanation)
- );
+ return $self->_make_bailout_token( $line, _trim( $explanation ) );
},
},
);
@@ -221,12 +206,12 @@
foreach my $token_data ( values %{ $self->{tokens} } ) {
if ( $line =~ $token_data->{syntax} ) {
my $handler = $token_data->{handler};
- $token = $self->$handler($line);
+ $token = $self->$handler( $line );
last;
}
}
- $token ||= $self->_make_unknown_token($line);
- return defined $token ? TAP::Parser::Result->new($token) : ();
+ $token ||= $self->_make_unknown_token( $line );
+ return defined $token ? TAP::Parser::Result->new( $token ) : ();
}
##############################################################################
@@ -310,8 +295,7 @@
$skip ||= 'SKIP';
}
if ( $skip && 0 != $tests_planned ) {
- warn
- "Specified SKIP directive in plan but more than 0 tests ($line)\n";
+ warn "Specified SKIP directive in plan but more than 0 tests ($line)\n";
}
return {
type => 'plan',
@@ -327,9 +311,9 @@
my %test = (
ok => $ok,
test_num => $num,
- description => _trim($desc),
- directive => uc($dir),
- explanation => _trim($explanation),
+ description => _trim( $desc ),
+ directive => uc( $dir ),
+ explanation => _trim( $explanation ),
raw => $line,
type => 'test',
);
@@ -349,7 +333,7 @@
return {
type => 'comment',
raw => $line,
- comment => _trim($1)
+ comment => _trim( $1 )
};
}
@@ -358,20 +342,20 @@
return {
type => 'bailout',
raw => $line,
- bailout => _trim($1)
+ bailout => _trim( $1 )
};
}
sub _make_yaml_token {
my ( $self, $pad, $marker ) = @_;
- my $yaml = TAP::Parser::YAMLish::Reader->new;
+ my $yaml = TAP::Parser::YAMLish::Reader->new;
my $stream = $self->{stream};
# Construct a reader that reads from our input stripping leading
# spaces from each line.
- my $leader = length($pad);
+ my $leader = length( $pad );
my $strip = qr{ ^ (\s{$leader}) (.*) $ }x;
my @extra = ( $marker );
my $reader = sub {
More information about the tapx-dev
mailing list