| 1 | package Text::MicroMason::ServerPages; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use Carp; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Safe; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||
| 8 | ###################################################################### | ||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||
| 10 | 1 | 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 | 1 | my $re_eol = "(?:\\r\\n|\\r|\\n|\\z)"; | |||||||||||||||||||||||||||||||
| 18 | 1 | my $re_tag = "perl|args|once|init|cleanup|doc|text|expr|file"; | |||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||
| 20 | 51 | ▶ | sub lex_token { | ||||||||||||||||||||||||||||||
|
Subroutine
lex_token: called CC=6 SCAR=19.1
Pod
documented
| |||||||||||||||||||||||||||||||||
| 21 | # Blocks in <%word> ... <%word> tags. | ||||||||||||||||||||||||||||||||
| 22 | /\G \<\%($re_tag)\> (.*?) \<\/\%\1\> $re_eol? /xcogs ? ( $1 => $2 ) : | ||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||
| 24 | # Blocks in <% ... %> tags. | ||||||||||||||||||||||||||||||||
| 25 | 51 | ▶ | /\G \<\% (\=|\&)? ( .*? ) \%\> /gcxs ? ( $block_types{$1 || ''} => $2 ) : | ||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition100%2/2
$1 || ''
MC/DC100%1/1
$1 || ''
$1
Truth table100%2/2
A
A= $1
| |||||||||||||||||||||||||||||||||
| 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 | 1; | |||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||
| 41 | __END__ | ||||||||||||||||||||||||||||||||