| 1 | package Text::MicroMason::QuickTemplate; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | 1 | require Text::MicroMason::Base; | |||||||||||||
| 4 | 1 | require Text::MicroMason::StoreOne; | |||||||||||||
| 5 | 1 | require Text::MicroMason::HasParams; | |||||||||||||
| 6 | 1 | push @ISA, map "Text::MicroMason::$_", qw( StoreOne HasParams ); | |||||||||||||
| 7 | |||||||||||||||
| 8 | 1 | require Exporter; | |||||||||||||
| 9 | 1 | $DONTSET = \""; | |||||||||||||
| 10 | 1 | ▶ | sub import { @EXPORT = '$DONTSET'; goto &Exporter::import } | ||||||||||||
|
Subroutine
import: called CC=1 SCAR=0.0
| |||||||||||||||
| 11 | |||||||||||||||
| 12 | ###################################################################### | ||||||||||||||
| 13 | |||||||||||||||
| 14 | 3 | ▶ | sub defaults { | ||||||||||||
|
Subroutine
defaults: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 15 | 3 | (shift)->NEXT('defaults'), delimiters => [ '{{', '}}' ], | |||||||||||||
| 16 | } | ||||||||||||||
| 17 | |||||||||||||||
| 18 | ###################################################################### | ||||||||||||||
| 19 | |||||||||||||||
| 20 | 31 | ▶ | sub lex_token { | ||||||||||||
|
Subroutine
lex_token: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||
| 21 | 31 | my $self = shift; | |||||||||||||
| 22 | |||||||||||||||
| 23 | 31 | my ($l_delim, $r_delim) = @{ $self->{'delimiters'} }; | |||||||||||||
| 24 | 31 | ▶ | /\G \Q$l_delim\E (.*?) \Q$r_delim\E/gcxs ? ( expr => | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 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 | ▶ | sub fill { (shift)->execute_again( @_ ) } | ||||||||||||
|
Subroutine
fill: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 38 | |||||||||||||||
| 39 | 2 | ▶ | sub pre_fill { unshift @{ (shift)->{params} }, { @_ } } | ||||||||||||
|
Subroutine
pre_fill: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 40 | |||||||||||||||
| 41 | 0 | ▶ | sub clear_values { @{ (shift)->{params} } = () } | ||||||||||||
|
Subroutine
clear_values: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||
| 42 | |||||||||||||||
| 43 | ###################################################################### | ||||||||||||||
| 44 | |||||||||||||||
| 45 | 1 | 1; | |||||||||||||
| 46 | |||||||||||||||
| 47 | __END__ | ||||||||||||||