|
Lines 60-65
sub build_tokens{
Link Here
|
| 60 |
$self->handler(end => "end", "self, line, tag, attr, text"); #signature is end( self, linenumber, tagename, original text ) |
60 |
$self->handler(end => "end", "self, line, tag, attr, text"); #signature is end( self, linenumber, tagename, original text ) |
| 61 |
$self->handler(declaration => "declaration", "self, line, text, is_cdata"); # declaration |
61 |
$self->handler(declaration => "declaration", "self, line, text, is_cdata"); # declaration |
| 62 |
$self->handler(comment => "comment", "self, line, text, is_cdata"); # comments |
62 |
$self->handler(comment => "comment", "self, line, text, is_cdata"); # comments |
|
|
63 |
$self->handler(process => "process", "self, line, text, is_cdata"); # processing statement <?...?> |
| 63 |
# $self->handler(default => "default", "self, line, text, is_cdata"); # anything else |
64 |
# $self->handler(default => "default", "self, line, text, is_cdata"); # anything else |
| 64 |
$self->marked_sections(1); #treat anything inside CDATA tags as text, should really make it a C4::TmplTokenType::CDATA |
65 |
$self->marked_sections(1); #treat anything inside CDATA tags as text, should really make it a C4::TmplTokenType::CDATA |
| 65 |
$self->unbroken_text(1); #make contiguous whitespace into a single token (can span multiple lines) |
66 |
$self->unbroken_text(1); #make contiguous whitespace into a single token (can span multiple lines) |
|
Lines 116-121
sub comment {
Link Here
|
| 116 |
push @tokens, $t; |
117 |
push @tokens, $t; |
| 117 |
} |
118 |
} |
| 118 |
|
119 |
|
|
|
120 |
sub process { |
| 121 |
my $self = shift; |
| 122 |
my $line = shift; |
| 123 |
my $work = shift; #original text |
| 124 |
my $is_cdata = shift; |
| 125 |
my $t = C4::TmplToken->new( $work, ($is_cdata? C4::TmplTokenType::CDATA : C4::TmplTokenType::TEXT), $line, $self->{filename} ); |
| 126 |
push @tokens, $t; |
| 127 |
} |
| 128 |
|
| 119 |
sub default { |
129 |
sub default { |
| 120 |
my $self = shift; |
130 |
my $self = shift; |
| 121 |
my $line = shift; |
131 |
my $line = shift; |