8 |
my $self = shift; |
my $self = shift; |
9 |
my $location = shift; |
my $location = shift; |
10 |
|
|
11 |
|
$self->SUPER::init(@_); |
12 |
$self->location($location) |
$self->location($location) |
13 |
if defined($location); |
if defined($location); |
14 |
|
|
78 |
return join ('', map $_->code, $self->content); |
return join ('', map $_->code, $self->content); |
79 |
} |
} |
80 |
|
|
81 |
|
# Morph the tree into what we really want to output |
82 |
|
sub cleanup |
83 |
|
{ |
84 |
|
my $self = shift; |
85 |
|
my $content_array = $self->content; |
86 |
|
|
87 |
|
# We must do the replacement from the back to the front, because a single element |
88 |
|
# may be replaced by none (or by many) at cleanup |
89 |
|
splice(@$content_array, $_, 1) = $$content_array[$_]->cleanup foreach reverse 0..$#{$content_array}; |
90 |
|
return ($self); |
91 |
|
} |
92 |
|
|
93 |
1; |
1; |