NAME
Syntax::SourceHighlight::HighlightToken - Perl class for libsource-highlight's srchilite::HighlightToken
SYNOPSIS
my
$hl
= Syntax::SourceHighlight->new();
$hl
->setHighlightEventListener(
sub
{
my
$highlight_event
=
shift
;
my
$highlight_token
=
$highlight_event
->{token};
(
"Prefix: '$highlight_token->{prefix}'; tokens"
);
foreach
( @{
$highlight_token
->{matched} } ) {
m/^(.*?):(.*)$/s;
(
" '$2' ($1)"
);
}
(
"\n"
);
}
);
$hl
->highlightString(
'my $test = 42;'
,
'perl.lang'
);
DESCRIPTION
This is the counterpart to the libsource-highlight's srchilite::HighlightEvent
class.
The following public attributes are exported:
matched (exported as an array of strings where the pair is concatenated and separated with colon)
These are not implemented:
matchedSubExps
rule
There is no Perl constructor for this package. None of its public methods are implemented:
copyFrom()
clearMatched()
addMatched()
SEE ALSO
The main documentation with examples is in the Syntax::SourceHighlight POD.