line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::MicroMason::ServerPages; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
416
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
4
|
1
|
|
|
1
|
|
2
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
42
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
430
|
use Safe; |
|
1
|
|
|
|
|
22603
|
|
|
1
|
|
|
|
|
158
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
###################################################################### |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my %block_types = ( |
11
|
|
|
|
|
|
|
'' => 'perl', # <% perl statements %> |
12
|
|
|
|
|
|
|
'=' => 'expr', # <%= perl expression %> |
13
|
|
|
|
|
|
|
'--' => 'doc', # <%-- this text will not appear in the output --%> |
14
|
|
|
|
|
|
|
'&' => 'file', # <%& filename argument %> |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $re_eol = "(?:\\r\\n|\\r|\\n|\\z)"; |
18
|
|
|
|
|
|
|
my $re_tag = "perl|args|once|init|cleanup|doc|text|expr|file"; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub lex_token { |
21
|
|
|
|
|
|
|
# Blocks in <%word> ... <%word> tags. |
22
|
|
|
|
|
|
|
/\G \<\%($re_tag)\> (.*?) \<\/\%\1\> $re_eol? /xcogs ? ( $1 => $2 ) : |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# Blocks in <% ... %> tags. |
25
|
51
|
50
|
100
|
51
|
1
|
358
|
/\G \<\% (\=|\&)? ( .*? ) \%\> /gcxs ? ( $block_types{$1 || ''} => $2 ) : |
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# Blocks in <%-- ... --%> tags. |
28
|
|
|
|
|
|
|
/\G \<\% \-\- ( .*? ) \-\- \%\> /gcxs ? ( 'doc' => $1 ) : |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# Things that don't match the above |
31
|
|
|
|
|
|
|
/\G ( (?: [^\<]+ | \<(?!\%) )? ) /gcxs ? ( 'text' => $1 ) : |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# Lexer error |
34
|
|
|
|
|
|
|
() |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
###################################################################### |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |