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
|
|
6
|
sub import { @EXPORT = '$DONTSET'; goto &Exporter::import } |
|
1
|
|
|
|
|
1383
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
###################################################################### |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub defaults { |
15
|
3
|
|
|
3
|
0
|
10
|
(shift)->NEXT('defaults'), delimiters => [ '{{', '}}' ], |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
###################################################################### |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub lex_token { |
21
|
31
|
|
|
31
|
0
|
36
|
my $self = shift; |
22
|
|
|
|
|
|
|
|
23
|
31
|
|
|
|
|
35
|
my ($l_delim, $r_delim) = @{ $self->{'delimiters'} }; |
|
31
|
|
|
|
|
52
|
|
24
|
31
|
50
|
|
|
|
277
|
/\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
|
2204
|
sub fill { (shift)->execute_again( @_ ) } |
38
|
|
|
|
|
|
|
|
39
|
2
|
|
|
2
|
0
|
465
|
sub pre_fill { unshift @{ (shift)->{params} }, { @_ } } |
|
2
|
|
|
|
|
12
|
|
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
0
|
0
|
|
sub clear_values { @{ (shift)->{params} } = () } |
|
0
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
###################################################################### |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |