line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lang::Tree::Builder::Scalar; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Lang::Tree::Builder::Scalar - simple class representing a scalar. |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $scalar = new Lang::Tree::Builder::Scalar(); |
10
|
|
|
|
|
|
|
$scalar->is_scalar == 1; # true |
11
|
|
|
|
|
|
|
$scalar->name eq 'scalar'; # true |
12
|
|
|
|
|
|
|
$scalar->lastpart eq 'scalar'; # true |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
This class is polymorphic with C and represents a |
15
|
|
|
|
|
|
|
simple scalar in a way that is convenient for the templates. |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head2 new |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Creates a new instance of a scalar. This is called via |
20
|
|
|
|
|
|
|
C and so is effectively a singleton. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=cut |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub new { |
25
|
2
|
|
|
2
|
1
|
13
|
my ($class) = @_; |
26
|
2
|
|
|
|
|
12
|
bless {}, $class; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 is_scalar |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Returns true. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=cut |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
1
|
1
|
662
|
sub is_scalar { 1 } |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 is_substantial |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Returns false. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |
42
|
|
|
|
|
|
|
|
43
|
1
|
|
|
1
|
1
|
6
|
sub is_substantial { 0 } |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 name |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Returns C. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
50
|
|
|
|
|
|
|
|
51
|
2
|
|
|
2
|
1
|
19
|
sub name { 'scalar' } |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head2 lastpart |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Returns C. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
1
|
|
|
1
|
1
|
4
|
sub lastpart { 'scalar' } |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |