line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::MicroMason::PLP; |
2
|
|
|
|
|
|
|
# Trick PAUSE into indexing us properly: Old versions of PAUSE used |
3
|
|
|
|
|
|
|
# Text::MicroMason::Commands::VERSION for Text::MicroMason::PL because |
4
|
|
|
|
|
|
|
# they're in the same file, so PLP gained version 1.9 on PAUSE, and new |
5
|
|
|
|
|
|
|
# versions won't be reindexed unless they have a greater version. |
6
|
|
|
|
|
|
|
our $VERSION = "2.18"; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
576
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
9
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
59
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
472
|
use Safe; |
|
1
|
|
|
|
|
35780
|
|
|
1
|
|
|
|
|
261
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
###################################################################### |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub lex_token { |
16
|
|
|
|
|
|
|
# Blocks in <: ... :> tags. |
17
|
51
|
100
|
|
51
|
1
|
344
|
/\G \< \: (\=)? ( .*? ) \: \> /gcxs ? ( ($1 ? 'expr' : 'perl') => $2 ) : |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# Blocks in <( ... )> tags. |
20
|
|
|
|
|
|
|
/\G \< \( ( .*? ) \) \> /gcxs ? ( 'include' => $1 ) : |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# Things that don't match the above |
23
|
|
|
|
|
|
|
/\G ( (?: [^\<]+ | \<(?![\:\(]) )? ) /gcxs ? ( 'text' => $1 ) : |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# Lexer error |
26
|
|
|
|
|
|
|
() |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# $perl_code = $mason->assemble( @tokens ); |
30
|
|
|
|
|
|
|
sub assemble { |
31
|
8
|
|
|
8
|
1
|
13
|
my $self = shift; |
32
|
8
|
|
|
|
|
27
|
my @tokens = @_; |
33
|
|
|
|
|
|
|
|
34
|
8
|
|
|
|
|
35
|
for ( my $position = 0; $position <= int( $#tokens / 2 ); $position ++ ) { |
35
|
51
|
50
|
|
|
|
129
|
if ( $tokens[$position * 2] eq 'include' ) { |
36
|
0
|
|
|
|
|
0
|
my $token = $tokens[$position * 2 + 1]; |
37
|
0
|
|
|
|
|
0
|
splice @tokens, $position * 2, 2, $self->lex( $self->read_file( $token ) ) |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
8
|
|
|
|
|
31
|
$self->NEXT('assemble', @tokens ); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
###################################################################### |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
package Text::MicroMason::Commands; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# Trick PAUSE into indexing us properly: this package used to be in |
49
|
|
|
|
|
|
|
# MicroMason.pm, so it gained version 1.07 on PAUSE, and the new ones |
50
|
|
|
|
|
|
|
# won't be reindexed unless they have a greater version. |
51
|
|
|
|
|
|
|
our $VERSION = "1.9"; |
52
|
|
|
|
|
|
|
|
53
|
1
|
|
|
1
|
|
8
|
use vars qw( $m ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
153
|
|
54
|
|
|
|
|
|
|
sub include { |
55
|
0
|
|
|
0
|
|
|
$m->execute( file => @_ ) |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub Include { |
59
|
0
|
|
|
0
|
|
|
$m->execute( file => @_ ) |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub ReadFile { |
63
|
0
|
|
|
0
|
|
|
$m->read_file( @_ ) |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub Entity { |
67
|
1
|
0
|
|
1
|
|
8
|
eval { require HTML::Entities; no strict; *Entity = \&HTML::Entities::encode } |
|
1
|
|
|
0
|
|
2
|
|
|
1
|
|
|
|
|
73
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
? goto &HTML::Entities::encode : die "Can't load HTML::Entities"; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub EncodeURI { |
73
|
1
|
0
|
|
1
|
|
6
|
eval { require URI::Escape; no strict; *Entity = \&URI::Escape::uri_escape } |
|
1
|
|
|
0
|
|
2
|
|
|
1
|
|
|
|
|
66
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
? goto &URI::Escape::uri_escape : die "Can't load HTML::Entities"; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
###################################################################### |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
__END__ |