line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Locale::Maketext::Extract::Plugin::Mason; |
2
|
|
|
|
|
|
|
$Locale::Maketext::Extract::Plugin::Mason::VERSION = '1.00'; |
3
|
4
|
|
|
4
|
|
26
|
use strict; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
174
|
|
4
|
4
|
|
|
4
|
|
24
|
use base qw(Locale::Maketext::Extract::Plugin::Base); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
1545
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: HTML::Mason (aka Mason 1) and Mason (aka Mason 2) format parser |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub file_types { |
10
|
18
|
|
|
18
|
1
|
55
|
return qw( * ); |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub extract { |
14
|
4
|
|
|
4
|
1
|
6
|
my $self = shift; |
15
|
4
|
|
|
|
|
10
|
local $_ = shift; |
16
|
|
|
|
|
|
|
|
17
|
4
|
|
|
|
|
7
|
my $line = 1; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# HTML::Mason (aka Mason 1) |
20
|
4
|
|
|
|
|
18
|
while (m!\G(.*?<&\|[ ]*/l(?:oc)?(?:[ ]*,[ ]*(.*?))?[ ]*&>(.*?)&>)!sg) { |
21
|
0
|
|
|
|
|
0
|
my ( $vars, $str ) = ( $2, $3 ); |
22
|
0
|
|
|
|
|
0
|
$line += ( () = ( $1 =~ /\n/g ) ); # cryptocontext! |
23
|
0
|
|
|
|
|
0
|
$self->add_entry( $str, $line, $vars ); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# Mason (aka Mason 2) |
27
|
4
|
|
|
|
|
23
|
while ( |
28
|
|
|
|
|
|
|
m!\G(.*?<%[ ]*(?:\$(?:\.|self->))fl(?:oc)?(?:[ ]*\((.*?)\))?[ ]*{[ ]*%>(.*?)%>)!sg |
29
|
|
|
|
|
|
|
) |
30
|
|
|
|
|
|
|
{ |
31
|
0
|
|
|
|
|
|
my ( $vars, $str ) = ( $2, $3 ); |
32
|
0
|
|
|
|
|
|
$line += ( () = ( $1 =~ /\n/g ) ); # cryptocontext! |
33
|
0
|
|
|
|
|
|
$self->add_entry( $str, $line, $vars ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |