line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::MicroMason::QuickTemplate; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
require Text::MicroMason::Base; |
4
|
|
|
|
|
|
|
require Text::MicroMason::StoreOne; |
5
|
|
|
|
|
|
|
require Text::MicroMason::HasParams; |
6
|
|
|
|
|
|
|
push @ISA, map "Text::MicroMason::$_", qw( StoreOne HasParams ); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Exporter; |
9
|
|
|
|
|
|
|
$DONTSET = \""; |
10
|
1
|
|
|
1
|
|
13
|
sub import { @EXPORT = '$DONTSET'; goto &Exporter::import } |
|
1
|
|
|
|
|
2329
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
###################################################################### |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub defaults { |
15
|
3
|
|
|
3
|
0
|
13
|
(shift)->NEXT('defaults'), delimiters => [ '{{', '}}' ], |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
###################################################################### |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub lex_token { |
21
|
31
|
|
|
31
|
0
|
42
|
my $self = shift; |
22
|
|
|
|
|
|
|
|
23
|
31
|
|
|
|
|
43
|
my ($l_delim, $r_delim) = @{ $self->{'delimiters'} }; |
|
31
|
|
|
|
|
63
|
|
24
|
31
|
50
|
|
|
|
337
|
/\G \Q$l_delim\E (.*?) \Q$r_delim\E/gcxs ? ( expr => |
|
|
100
|
|
|
|
|
|
25
|
|
|
|
|
|
|
'my @param = $m->param(' . "'\Q$1\E'" . '); |
26
|
|
|
|
|
|
|
scalar @param or die "could not resolve the following symbol: ' . $1 . '"; |
27
|
|
|
|
|
|
|
( $param[0] eq "' . $DONTSET . '" ) ? "{{' . $1 . '}}" : $param[0]' ) : |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# Things that don't match the above |
30
|
|
|
|
|
|
|
/\G ( (?: [^\{] | \{(?!\{) )+ ) /gcxs ? ( 'text' => $1 ) : |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
() |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
###################################################################### |
36
|
|
|
|
|
|
|
|
37
|
7
|
|
|
7
|
0
|
2586
|
sub fill { (shift)->execute_again( @_ ) } |
38
|
|
|
|
|
|
|
|
39
|
2
|
|
|
2
|
0
|
616
|
sub pre_fill { unshift @{ (shift)->{params} }, { @_ } } |
|
2
|
|
|
|
|
16
|
|
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
0
|
0
|
|
sub clear_values { @{ (shift)->{params} } = () } |
|
0
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
###################################################################### |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |