line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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. |
4
|
|
|
|
|
|
|
|
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 |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#kate xml version 1.02 |
9
|
|
|
|
|
|
|
#kate version 2.4 |
10
|
|
|
|
|
|
|
#generated: Sun Feb 3 22:02:04 2008, localtime |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Syntax::Highlight::Engine::Kate::Diff; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.12'; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
542
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
17
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
18
|
1
|
|
|
1
|
|
4
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
490
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
1
|
|
|
1
|
0
|
654
|
my $proto = shift; |
22
|
1
|
|
33
|
|
|
6
|
my $class = ref($proto) || $proto; |
23
|
1
|
|
|
|
|
9
|
my $self = $class->SUPER::new(@_); |
24
|
1
|
|
|
|
|
9
|
$self->attributes({ |
25
|
|
|
|
|
|
|
'Added line' => 'String', |
26
|
|
|
|
|
|
|
'Comment' => 'Comment', |
27
|
|
|
|
|
|
|
'Data Type' => 'DataType', |
28
|
|
|
|
|
|
|
'Keyword' => 'Keyword', |
29
|
|
|
|
|
|
|
'Normal Text' => 'Normal', |
30
|
|
|
|
|
|
|
'Removed line' => 'Others', |
31
|
|
|
|
|
|
|
}); |
32
|
1
|
|
|
|
|
16
|
$self->contextdata({ |
33
|
|
|
|
|
|
|
'Added' => { |
34
|
|
|
|
|
|
|
callback => \&parseAdded, |
35
|
|
|
|
|
|
|
attribute => 'Added line', |
36
|
|
|
|
|
|
|
lineending => '#pop', |
37
|
|
|
|
|
|
|
}, |
38
|
|
|
|
|
|
|
'Data' => { |
39
|
|
|
|
|
|
|
callback => \&parseData, |
40
|
|
|
|
|
|
|
attribute => 'Data Type', |
41
|
|
|
|
|
|
|
lineending => '#pop', |
42
|
|
|
|
|
|
|
}, |
43
|
|
|
|
|
|
|
'Keyword' => { |
44
|
|
|
|
|
|
|
callback => \&parseKeyword, |
45
|
|
|
|
|
|
|
attribute => 'Keyword', |
46
|
|
|
|
|
|
|
lineending => '#pop', |
47
|
|
|
|
|
|
|
}, |
48
|
|
|
|
|
|
|
'Normal' => { |
49
|
|
|
|
|
|
|
callback => \&parseNormal, |
50
|
|
|
|
|
|
|
attribute => 'Normal Text', |
51
|
|
|
|
|
|
|
}, |
52
|
|
|
|
|
|
|
'Removed' => { |
53
|
|
|
|
|
|
|
callback => \&parseRemoved, |
54
|
|
|
|
|
|
|
attribute => 'Removed line', |
55
|
|
|
|
|
|
|
lineending => '#pop', |
56
|
|
|
|
|
|
|
}, |
57
|
|
|
|
|
|
|
}); |
58
|
1
|
|
|
|
|
5
|
$self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
59
|
1
|
|
|
|
|
4
|
$self->basecontext('Normal'); |
60
|
1
|
|
|
|
|
5
|
$self->keywordscase(0); |
61
|
1
|
|
|
|
|
4
|
$self->initialize; |
62
|
1
|
|
|
|
|
4
|
bless ($self, $class); |
63
|
1
|
|
|
|
|
5
|
return $self; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub language { |
67
|
0
|
|
|
0
|
0
|
|
return 'Diff'; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub parseAdded { |
71
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
72
|
0
|
|
|
|
|
|
return 0; |
73
|
|
|
|
|
|
|
}; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub parseData { |
76
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
77
|
0
|
|
|
|
|
|
return 0; |
78
|
|
|
|
|
|
|
}; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub parseKeyword { |
81
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
82
|
0
|
|
|
|
|
|
return 0; |
83
|
|
|
|
|
|
|
}; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub parseNormal { |
86
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
87
|
|
|
|
|
|
|
# String => '(\+\+\+|\-\-\-|\*\*\*|diff|\d)' |
88
|
|
|
|
|
|
|
# attribute => 'Keyword' |
89
|
|
|
|
|
|
|
# column => '0' |
90
|
|
|
|
|
|
|
# context => 'Keyword' |
91
|
|
|
|
|
|
|
# type => 'RegExpr' |
92
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '(\\+\\+\\+|\\-\\-\\-|\\*\\*\\*|diff|\\d)', 0, 0, 0, 0, 0, 'Keyword', 'Keyword')) { |
93
|
0
|
|
|
|
|
|
return 1 |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
# String => '(\+|>|!)' |
96
|
|
|
|
|
|
|
# attribute => 'Added line' |
97
|
|
|
|
|
|
|
# column => '0' |
98
|
|
|
|
|
|
|
# context => 'Added' |
99
|
|
|
|
|
|
|
# type => 'RegExpr' |
100
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '(\\+|>|!)', 0, 0, 0, 0, 0, 'Added', 'Added line')) { |
101
|
0
|
|
|
|
|
|
return 1 |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
# String => '-<' |
104
|
|
|
|
|
|
|
# attribute => 'Removed line' |
105
|
|
|
|
|
|
|
# column => '0' |
106
|
|
|
|
|
|
|
# context => 'Removed' |
107
|
|
|
|
|
|
|
# type => 'AnyChar' |
108
|
0
|
0
|
|
|
|
|
if ($self->testAnyChar($text, '-<', 0, 0, 0, 0, 'Removed', 'Removed line')) { |
109
|
0
|
|
|
|
|
|
return 1 |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
# attribute => 'Data Type' |
112
|
|
|
|
|
|
|
# char => '@' |
113
|
|
|
|
|
|
|
# char1 => '@' |
114
|
|
|
|
|
|
|
# column => '0' |
115
|
|
|
|
|
|
|
# context => 'Data' |
116
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
117
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '@', '@', 0, 0, 0, 0, 0, 'Data', 'Data Type')) { |
118
|
0
|
|
|
|
|
|
return 1 |
119
|
|
|
|
|
|
|
} |
120
|
0
|
|
|
|
|
|
return 0; |
121
|
|
|
|
|
|
|
}; |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
sub parseRemoved { |
124
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
125
|
0
|
|
|
|
|
|
return 0; |
126
|
|
|
|
|
|
|
}; |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
1; |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
__END__ |