1 # Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved.
2 # This program is free software; you can redistribute it and/or
3 # modify it under the same terms as Perl itself.
5 # This file was generated from the 'diff.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #generated: Sun Feb 3 22:02:04 2008, localtime
12 package Syntax::Highlight::Engine::Kate::Diff;
14 our $VERSION = '0.06';
18 use base('Syntax::Highlight::Engine::Kate::Template');
22 my $class = ref($proto) || $proto;
23 my $self = $class->SUPER::new(@_);
25 'Added line' => 'String',
26 'Comment' => 'Comment',
27 'Data Type' => 'DataType',
28 'Keyword' => 'Keyword',
29 'Normal Text' => 'Normal',
30 'Removed line' => 'Others',
34 callback => \&parseAdded,
35 attribute => 'Added line',
39 callback => \&parseData,
40 attribute => 'Data Type',
44 callback => \&parseKeyword,
45 attribute => 'Keyword',
49 callback => \&parseNormal,
50 attribute => 'Normal Text',
53 callback => \&parseRemoved,
54 attribute => 'Removed line',
58 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
59 $self->basecontext('Normal');
60 $self->keywordscase(0);
62 bless ($self, $class);
71 my ($self, $text) = @_;
76 my ($self, $text) = @_;
81 my ($self, $text) = @_;
86 my ($self, $text) = @_;
87 # String => '(\+\+\+|\-\-\-|\*\*\*|diff|\d)'
88 # attribute => 'Keyword'
90 # context => 'Keyword'
92 if ($self->testRegExpr($text, '(\\+\\+\\+|\\-\\-\\-|\\*\\*\\*|diff|\\d)', 0, 0, 0, 0, 0, 'Keyword', 'Keyword')) {
95 # String => '(\+|>|!)'
96 # attribute => 'Added line'
100 if ($self->testRegExpr($text, '(\\+|>|!)', 0, 0, 0, 0, 0, 'Added', 'Added line')) {
104 # attribute => 'Removed line'
106 # context => 'Removed'
108 if ($self->testAnyChar($text, '-<', 0, 0, 0, 0, 'Removed', 'Removed line')) {
111 # attribute => 'Data Type'
116 # type => 'Detect2Chars'
117 if ($self->testDetect2Chars($text, '@', '@', 0, 0, 0, 0, 0, 'Data', 'Data Type')) {
124 my ($self, $text) = @_;
135 Syntax::Highlight::Engine::Kate::Diff - a Plugin for Diff syntax highlighting
139 require Syntax::Highlight::Engine::Kate::Diff;
140 my $sh = new Syntax::Highlight::Engine::Kate::Diff([
145 Syntax::Highlight::Engine::Kate::Diff is a plugin module that provides syntax highlighting
146 for Diff to the Syntax::Haghlight::Engine::Kate highlighting engine.
148 This code is generated from the syntax definition files used
150 It works quite fine, but can use refinement and optimization.
152 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
158 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
164 Unknown. If you find any, please contact the author