line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Xslate::PP::Type::Raw; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
26
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use Carp (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
7
|
1
|
|
|
1
|
|
4
|
use Text::Xslate::PP::Const qw(TXt_RAW); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
54
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use overload ( |
10
|
1
|
|
|
|
|
6
|
'""' => 'as_string', |
11
|
|
|
|
|
|
|
fallback => 1, |
12
|
1
|
|
|
1
|
|
1618
|
); |
|
1
|
|
|
|
|
1034
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $the_class = TXt_RAW; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub new { |
17
|
0
|
|
|
0
|
0
|
|
my ( $class, $str ) = @_; |
18
|
|
|
|
|
|
|
|
19
|
0
|
0
|
|
|
|
|
Carp::croak("Usage: $the_class->new(str)") if ( @_ != 2 ); |
20
|
|
|
|
|
|
|
|
21
|
0
|
0
|
|
|
|
|
if ( ref $class ) { |
|
|
0
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
Carp::croak("You cannot call $the_class->new() as an instance method"); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
elsif ( $class ne $the_class ) { |
25
|
0
|
|
|
|
|
|
Carp::croak("You cannot extend $the_class ($class)"); |
26
|
|
|
|
|
|
|
} |
27
|
0
|
0
|
|
|
|
|
$str = ${$str} if ref($str) eq $the_class; # unmark |
|
0
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
return bless \$str, $the_class; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub as_string { |
32
|
0
|
0
|
|
0
|
0
|
|
unless ( ref $_[0] ) { |
33
|
0
|
|
|
|
|
|
Carp::croak("You cannot call $the_class->as_string() as a class method"); |
34
|
|
|
|
|
|
|
} |
35
|
0
|
|
|
|
|
|
return ${ $_[0] }; |
|
0
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
0
|
0
|
|
sub defined { 1 } |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
package |
41
|
|
|
|
|
|
|
Text::Xslate::Type::Raw; |
42
|
|
|
|
|
|
|
our @ISA = qw(Text::Xslate::PP::Type::Raw); |
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
__END__ |