Skip to content

Commit f9b7279

Browse files
committed
Fix false-positive detection of Labels
Un-mark affected tests as TODO.
1 parent ac24a9e commit f9b7279

File tree

7 files changed

+5
-7
lines changed

7 files changed

+5
-7
lines changed

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Revision history for Perl extension PPI
33
{{$NEXT}}
44
Summary:
55
- Parse prototypes as literal quotes, enables parens and newlines in protos
6+
- Fix false positive detection of labels (GH#289) (Dan Church)
67

78
Details:
89
- Wrapped most Document->new calls in tests with automatic checks

lib/PPI/Token/Word.pm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,12 @@ sub __TOKENIZER__commit {
305305
# attribute operator doesn't directly
306306
# touch the object name already works.
307307
$token_class = 'Word';
308-
} else {
308+
} elsif ( !($tokens[0] and $tokens[0]->isa('PPI::Token::Operator')) ) {
309309
$word .= $1;
310310
$t->{line_cursor} += length($1);
311311
$token_class = 'Label';
312+
} else {
313+
$token_class = 'Word';
312314
}
313315
} elsif ( $word eq '_' ) {
314316
$token_class = 'Magic';

t/08_regression.t

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use if !(-e 'META.yml'), "Test::InDistDir";
88
use lib 't/lib';
99
use PPI::Test::pragmas;
10-
use Test::More tests => 1087 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
10+
use Test::More tests => 1085 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
1111

1212
use PPI ();
1313
use PPI::Test qw( pause );
@@ -22,11 +22,6 @@ use Helper 'safe_new';
2222

2323
PPI::Test::Run->run_testdir(qw{ t data 08_regression });
2424

25-
{
26-
local $TODO = 'known bug';
27-
PPI::Test::Run->run_testdir(qw{ t data 08_regression_todo });
28-
}
29-
3025

3126

3227

0 commit comments

Comments
 (0)