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 'debianchangelog.xml' file of the syntax highlight |
6
|
|
|
|
|
|
|
# engine of the kate text editor (http://www.kate-editor.org |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#kate xml version 0.62 |
9
|
|
|
|
|
|
|
#kate version 2.4 |
10
|
|
|
|
|
|
|
#generated: Sun Feb 3 22:02:04 2008, localtime |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Syntax::Highlight::Engine::Kate::Debian_Changelog; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.14'; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
486
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
25
|
|
17
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
18
|
1
|
|
|
1
|
|
4
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
491
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
1
|
|
|
1
|
0
|
541
|
my $proto = shift; |
22
|
1
|
|
33
|
|
|
6
|
my $class = ref($proto) || $proto; |
23
|
1
|
|
|
|
|
7
|
my $self = $class->SUPER::new(@_); |
24
|
1
|
|
|
|
|
7
|
$self->attributes({ |
25
|
|
|
|
|
|
|
'Bug' => 'DataType', |
26
|
|
|
|
|
|
|
'Data' => 'DataType', |
27
|
|
|
|
|
|
|
'Email' => 'Others', |
28
|
|
|
|
|
|
|
'Keyword' => 'Keyword', |
29
|
|
|
|
|
|
|
'Normal Text' => 'Normal', |
30
|
|
|
|
|
|
|
'Version' => 'DataType', |
31
|
|
|
|
|
|
|
}); |
32
|
1
|
|
|
|
|
5
|
$self->listAdd('distributions', |
33
|
|
|
|
|
|
|
'experimental', |
34
|
|
|
|
|
|
|
'frozen', |
35
|
|
|
|
|
|
|
'stable', |
36
|
|
|
|
|
|
|
'testing', |
37
|
|
|
|
|
|
|
'unstable', |
38
|
|
|
|
|
|
|
); |
39
|
1
|
|
|
|
|
3
|
$self->listAdd('keywords', |
40
|
|
|
|
|
|
|
'urgency', |
41
|
|
|
|
|
|
|
); |
42
|
1
|
|
|
|
|
3
|
$self->listAdd('urgencies', |
43
|
|
|
|
|
|
|
'bug', |
44
|
|
|
|
|
|
|
'emergency', |
45
|
|
|
|
|
|
|
'high', |
46
|
|
|
|
|
|
|
'low', |
47
|
|
|
|
|
|
|
'medium', |
48
|
|
|
|
|
|
|
); |
49
|
1
|
|
|
|
|
10
|
$self->contextdata({ |
50
|
|
|
|
|
|
|
'Head' => { |
51
|
|
|
|
|
|
|
callback => \&parseHead, |
52
|
|
|
|
|
|
|
attribute => 'Normal Text', |
53
|
|
|
|
|
|
|
lineending => '#pop', |
54
|
|
|
|
|
|
|
}, |
55
|
|
|
|
|
|
|
'Version' => { |
56
|
|
|
|
|
|
|
callback => \&parseVersion, |
57
|
|
|
|
|
|
|
attribute => 'Version', |
58
|
|
|
|
|
|
|
lineending => '#pop', |
59
|
|
|
|
|
|
|
}, |
60
|
|
|
|
|
|
|
'noname' => { |
61
|
|
|
|
|
|
|
callback => \&parsenoname, |
62
|
|
|
|
|
|
|
attribute => 'Normal Text', |
63
|
|
|
|
|
|
|
}, |
64
|
|
|
|
|
|
|
}); |
65
|
1
|
|
|
|
|
5
|
$self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
66
|
1
|
|
|
|
|
4
|
$self->basecontext('noname'); |
67
|
1
|
|
|
|
|
4
|
$self->keywordscase(0); |
68
|
1
|
|
|
|
|
2
|
$self->initialize; |
69
|
1
|
|
|
|
|
2
|
bless ($self, $class); |
70
|
1
|
|
|
|
|
2
|
return $self; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub language { |
74
|
0
|
|
|
0
|
0
|
|
return 'Debian Changelog'; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub parseHead { |
78
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
79
|
|
|
|
|
|
|
# attribute => 'Keyword' |
80
|
|
|
|
|
|
|
# char => '(' |
81
|
|
|
|
|
|
|
# context => 'Version' |
82
|
|
|
|
|
|
|
# type => 'DetectChar' |
83
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'Version', 'Keyword')) { |
84
|
0
|
|
|
|
|
|
return 1 |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
# String => '[,;=]' |
87
|
|
|
|
|
|
|
# attribute => 'Keyword' |
88
|
|
|
|
|
|
|
# context => '#stay' |
89
|
|
|
|
|
|
|
# type => 'RegExpr' |
90
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '[,;=]', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { |
91
|
0
|
|
|
|
|
|
return 1 |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
# String => 'keywords' |
94
|
|
|
|
|
|
|
# attribute => 'Keyword' |
95
|
|
|
|
|
|
|
# context => '#stay' |
96
|
|
|
|
|
|
|
# type => 'keyword' |
97
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { |
98
|
0
|
|
|
|
|
|
return 1 |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
# String => 'distributions' |
101
|
|
|
|
|
|
|
# attribute => 'Data' |
102
|
|
|
|
|
|
|
# context => '#stay' |
103
|
|
|
|
|
|
|
# type => 'keyword' |
104
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'distributions', 0, undef, 0, '#stay', 'Data')) { |
105
|
0
|
|
|
|
|
|
return 1 |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
# String => 'urgencies' |
108
|
|
|
|
|
|
|
# attribute => 'Data' |
109
|
|
|
|
|
|
|
# context => '#stay' |
110
|
|
|
|
|
|
|
# type => 'keyword' |
111
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'urgencies', 0, undef, 0, '#stay', 'Data')) { |
112
|
0
|
|
|
|
|
|
return 1 |
113
|
|
|
|
|
|
|
} |
114
|
0
|
|
|
|
|
|
return 0; |
115
|
|
|
|
|
|
|
}; |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
sub parseVersion { |
118
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
119
|
|
|
|
|
|
|
# attribute => 'Keyword' |
120
|
|
|
|
|
|
|
# char => ')' |
121
|
|
|
|
|
|
|
# context => '#pop' |
122
|
|
|
|
|
|
|
# type => 'DetectChar' |
123
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { |
124
|
0
|
|
|
|
|
|
return 1 |
125
|
|
|
|
|
|
|
} |
126
|
0
|
|
|
|
|
|
return 0; |
127
|
|
|
|
|
|
|
}; |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
sub parsenoname { |
130
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
131
|
|
|
|
|
|
|
# String => '[^ ]*' |
132
|
|
|
|
|
|
|
# attribute => 'Keyword' |
133
|
|
|
|
|
|
|
# column => '0' |
134
|
|
|
|
|
|
|
# context => 'Head' |
135
|
|
|
|
|
|
|
# type => 'RegExpr' |
136
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '[^ ]*', 0, 0, 0, 0, 0, 'Head', 'Keyword')) { |
137
|
0
|
|
|
|
|
|
return 1 |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
# String => '<.*@.*>' |
140
|
|
|
|
|
|
|
# attribute => 'Email' |
141
|
|
|
|
|
|
|
# context => '#stay' |
142
|
|
|
|
|
|
|
# type => 'RegExpr' |
143
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '<.*@.*>', 0, 0, 0, undef, 0, '#stay', 'Email')) { |
144
|
0
|
|
|
|
|
|
return 1 |
145
|
|
|
|
|
|
|
} |
146
|
|
|
|
|
|
|
# String => ' \-\-' |
147
|
|
|
|
|
|
|
# attribute => 'Keyword' |
148
|
|
|
|
|
|
|
# column => '0' |
149
|
|
|
|
|
|
|
# context => '#stay' |
150
|
|
|
|
|
|
|
# type => 'RegExpr' |
151
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, ' \\-\\-', 0, 0, 0, 0, 0, '#stay', 'Keyword')) { |
152
|
0
|
|
|
|
|
|
return 1 |
153
|
|
|
|
|
|
|
} |
154
|
|
|
|
|
|
|
# String => ' \*' |
155
|
|
|
|
|
|
|
# attribute => 'Keyword' |
156
|
|
|
|
|
|
|
# column => '0' |
157
|
|
|
|
|
|
|
# context => '#stay' |
158
|
|
|
|
|
|
|
# type => 'RegExpr' |
159
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, ' \\*', 0, 0, 0, 0, 0, '#stay', 'Keyword')) { |
160
|
0
|
|
|
|
|
|
return 1 |
161
|
|
|
|
|
|
|
} |
162
|
|
|
|
|
|
|
# String => '[Cc][Ll][Oo][Ss][Ee][Ss]:[\s]*(([Bb][Uu][Gg]\s*)?#\s*\d+)(\s*, *([Bb[Uu][Gg]\s*)?#\s*\d+)*' |
163
|
|
|
|
|
|
|
# attribute => 'Bug' |
164
|
|
|
|
|
|
|
# context => '#stay' |
165
|
|
|
|
|
|
|
# type => 'RegExpr' |
166
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '[Cc][Ll][Oo][Ss][Ee][Ss]:[\\s]*(([Bb][Uu][Gg]\\s*)?#\\s*\\d+)(\\s*, *([Bb[Uu][Gg]\\s*)?#\\s*\\d+)*', 0, 0, 0, undef, 0, '#stay', 'Bug')) { |
167
|
0
|
|
|
|
|
|
return 1 |
168
|
|
|
|
|
|
|
} |
169
|
0
|
|
|
|
|
|
return 0; |
170
|
|
|
|
|
|
|
}; |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
1; |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
__END__ |