NAME
Syntax::SourceHighlight::HighlightToken - Perl class for libsource-highlight's srchilite::HighlightToken
SYNOPSIS
use Syntax::SourceHighlight;
my $hl = Syntax::SourceHighlight->new();
$hl->setHighlightEventListener(
sub {
my $highlight_event = shift;
my $highlight_token = $highlight_event->{token};
print( "Prefix: '$highlight_token->{prefix}'; tokens" );
foreach ( @{ $highlight_token->{matched} } ) {
m/^(.*?):(.*)$/s;
print(" '$2' ($1)");
}
print("\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.