line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Snippet::TabStop::Parser; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
8
|
|
|
8
|
|
286
|
$Text::Snippet::TabStop::Parser::VERSION = '0.04'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: Parses an individual tab stop |
7
|
|
|
|
|
|
|
|
8
|
8
|
|
|
8
|
|
52
|
use strict; |
|
8
|
|
|
|
|
18
|
|
|
8
|
|
|
|
|
318
|
|
9
|
8
|
|
|
8
|
|
47
|
use warnings; |
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
5695
|
|
10
|
8
|
|
|
8
|
|
65
|
use List::Util qw(first); |
|
8
|
|
|
|
|
18
|
|
|
8
|
|
|
|
|
1174
|
|
11
|
8
|
|
|
8
|
|
50
|
use Carp qw(croak); |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
1036
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my @types; |
14
|
|
|
|
|
|
|
BEGIN { |
15
|
8
|
|
|
8
|
|
20
|
@types = map { "Text::Snippet::TabStop::$_" } qw( Basic WithDefault WithTransformer ); |
|
24
|
|
|
|
|
78
|
|
16
|
8
|
|
|
|
|
25
|
for(@types){ |
17
|
24
|
|
|
|
|
1962
|
eval "require $_"; |
18
|
24
|
50
|
|
|
|
1321
|
croak $@ if $@; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub parse { |
24
|
70
|
|
|
70
|
1
|
117
|
my $class = shift; |
25
|
70
|
|
|
|
|
95
|
my $src = shift; |
26
|
70
|
|
|
|
|
111
|
foreach my $t(@types){ |
27
|
92
|
|
|
|
|
383
|
my $p = $t->parse($src); |
28
|
92
|
100
|
|
|
|
329
|
return $p if defined $p; |
29
|
|
|
|
|
|
|
} |
30
|
0
|
|
|
|
|
|
croak "unable to find parser for tab stop source: [$src]"; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |