File: kate.pl

package info (click to toggle)
libsyntax-highlight-engine-kate-perl 0.14%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 3,844 kB
  • sloc: perl: 84,065; ruby: 176; asm: 166; cpp: 144; jsp: 128; haskell: 116; sh: 111; f90: 99; python: 98; ml: 75; javascript: 61; xml: 43; yacc: 37; ansic: 32; tcl: 29; lisp: 24; makefile: 15; awk: 13; php: 5
file content (24 lines) | stat: -rwxr-xr-x 465 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl 
use strict;
use warnings FATAL => 'all';

use Data::Dumper;
use Path::Tiny;
use Syntax::Highlight::Engine::Kate::All;
use Syntax::Highlight::Engine::Kate;

my $kate = Syntax::Highlight::Engine::Kate->new(
	language => 'Perl',
);

my $text = path(shift)->slurp;
my @hl = $kate->highlight($text);
print "==\n";
#print Dumper \@hl;
while (@hl) {
	my $string = shift @hl;
	my $type = shift @hl;
	$type ||= 'Normal';
	print "'$string'    '$type'\n";

}