#!/usr/bin/perl -w
# Copyright (c) 2005 Hans Jeuken. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
use strict;
use Term::ANSIColor;
use Syntax::Highlight::Engine::Kate;
unless (@ARGV) { die "You must supply a language mode as parameter" };
my $syntax = shift @ARGV;
my $hl = new Syntax::Highlight::Engine::Kate(
language => $syntax,
substitutions => {
'<' => '<',
'>' => '>',
'&' => '&',
' ' => ' ',
"\t" => ' ',
"\n" => "
\n",
},
format_table => {
Alert => ['', ''],
BaseN => ['', ''],
BString => ['', ''],
Char => ['', ''],
Comment => ['', ''],
DataType => ['', ''],
DecVal => ['', ''],
Error => ['', ''],
Float => ['', ''],
Function => ['', ''],
IString => ['', ''],
Keyword => ['', ''],
Normal => ['', ''],
Operator => ['', ''],
Others => ['', ''],
RegionMarker => ['', ''],
Reserved => ['', ''],
String => ['', ''],
Variable => ['', ''],
Warning => ['', ''],
},
);
print "\n\n\n\n";
my $text = "";
while (my $in = <>) {
$text = $text . $in;
# print $hl->highlightText($in);
}
print $hl->highlightText($text);
print "\n\n"