| 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 'rpmspec.xml' file of the syntax highlight |
|
6
|
|
|
|
|
|
|
# engine of the kate text editor (http://www.kate-editor.org |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#kate xml version 1.1 |
|
9
|
|
|
|
|
|
|
#kate version 2.4 |
|
10
|
|
|
|
|
|
|
#generated: Sun Feb 3 22:02:06 2008, localtime |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Syntax::Highlight::Engine::Kate::RPM_Spec; |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.12'; |
|
15
|
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
375
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
25
|
|
|
17
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
24
|
|
|
18
|
1
|
|
|
1
|
|
4
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
485
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
|
21
|
1
|
|
|
1
|
0
|
577
|
my $proto = shift; |
|
22
|
1
|
|
33
|
|
|
6
|
my $class = ref($proto) || $proto; |
|
23
|
1
|
|
|
|
|
8
|
my $self = $class->SUPER::new(@_); |
|
24
|
1
|
|
|
|
|
9
|
$self->attributes({ |
|
25
|
|
|
|
|
|
|
'Blue' => 'DecVal', |
|
26
|
|
|
|
|
|
|
'Comment' => 'Comment', |
|
27
|
|
|
|
|
|
|
'Data' => 'DataType', |
|
28
|
|
|
|
|
|
|
'Keyword' => 'Keyword', |
|
29
|
|
|
|
|
|
|
'Normal Text' => 'Normal', |
|
30
|
|
|
|
|
|
|
'Red' => 'String', |
|
31
|
|
|
|
|
|
|
}); |
|
32
|
1
|
|
|
|
|
5
|
$self->listAdd('keywords', |
|
33
|
|
|
|
|
|
|
'BuildArch', |
|
34
|
|
|
|
|
|
|
'BuildArchitectures', |
|
35
|
|
|
|
|
|
|
'BuildConflicts', |
|
36
|
|
|
|
|
|
|
'BuildRequires', |
|
37
|
|
|
|
|
|
|
'BuildRoot', |
|
38
|
|
|
|
|
|
|
'Conflicts', |
|
39
|
|
|
|
|
|
|
'Copyright', |
|
40
|
|
|
|
|
|
|
'Distribution', |
|
41
|
|
|
|
|
|
|
'Epoch', |
|
42
|
|
|
|
|
|
|
'ExcludeArch', |
|
43
|
|
|
|
|
|
|
'ExcludeOs', |
|
44
|
|
|
|
|
|
|
'ExclusiveArch', |
|
45
|
|
|
|
|
|
|
'ExclusiveOs', |
|
46
|
|
|
|
|
|
|
'Group', |
|
47
|
|
|
|
|
|
|
'License', |
|
48
|
|
|
|
|
|
|
'Name', |
|
49
|
|
|
|
|
|
|
'Obsoletes', |
|
50
|
|
|
|
|
|
|
'Packager', |
|
51
|
|
|
|
|
|
|
'PreReq', |
|
52
|
|
|
|
|
|
|
'Prefix', |
|
53
|
|
|
|
|
|
|
'Provides', |
|
54
|
|
|
|
|
|
|
'Release', |
|
55
|
|
|
|
|
|
|
'Requires', |
|
56
|
|
|
|
|
|
|
'Serial', |
|
57
|
|
|
|
|
|
|
'Source', |
|
58
|
|
|
|
|
|
|
'Summary', |
|
59
|
|
|
|
|
|
|
'URL', |
|
60
|
|
|
|
|
|
|
'Url', |
|
61
|
|
|
|
|
|
|
'Vendor', |
|
62
|
|
|
|
|
|
|
'Version', |
|
63
|
|
|
|
|
|
|
); |
|
64
|
1
|
|
|
|
|
3
|
$self->listAdd('types', |
|
65
|
|
|
|
|
|
|
'Artistic', |
|
66
|
|
|
|
|
|
|
'GPL', |
|
67
|
|
|
|
|
|
|
'LGPL', |
|
68
|
|
|
|
|
|
|
); |
|
69
|
1
|
|
|
|
|
10
|
$self->contextdata({ |
|
70
|
|
|
|
|
|
|
'Comment' => { |
|
71
|
|
|
|
|
|
|
callback => \&parseComment, |
|
72
|
|
|
|
|
|
|
attribute => 'Comment', |
|
73
|
|
|
|
|
|
|
lineending => '#pop', |
|
74
|
|
|
|
|
|
|
}, |
|
75
|
|
|
|
|
|
|
'Normal' => { |
|
76
|
|
|
|
|
|
|
callback => \&parseNormal, |
|
77
|
|
|
|
|
|
|
attribute => 'Normal Text', |
|
78
|
|
|
|
|
|
|
}, |
|
79
|
|
|
|
|
|
|
'Some Context' => { |
|
80
|
|
|
|
|
|
|
callback => \&parseSomeContext, |
|
81
|
|
|
|
|
|
|
attribute => 'Keyword', |
|
82
|
|
|
|
|
|
|
lineending => '#pop', |
|
83
|
|
|
|
|
|
|
}, |
|
84
|
|
|
|
|
|
|
'Some Context2' => { |
|
85
|
|
|
|
|
|
|
callback => \&parseSomeContext2, |
|
86
|
|
|
|
|
|
|
attribute => 'Blue', |
|
87
|
|
|
|
|
|
|
lineending => '#pop', |
|
88
|
|
|
|
|
|
|
}, |
|
89
|
|
|
|
|
|
|
}); |
|
90
|
1
|
|
|
|
|
5
|
$self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
|
91
|
1
|
|
|
|
|
3
|
$self->basecontext('Normal'); |
|
92
|
1
|
|
|
|
|
4
|
$self->keywordscase(0); |
|
93
|
1
|
|
|
|
|
3
|
$self->initialize; |
|
94
|
1
|
|
|
|
|
3
|
bless ($self, $class); |
|
95
|
1
|
|
|
|
|
3
|
return $self; |
|
96
|
|
|
|
|
|
|
} |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub language { |
|
99
|
0
|
|
|
0
|
0
|
|
return 'RPM Spec'; |
|
100
|
|
|
|
|
|
|
} |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub parseComment { |
|
103
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
104
|
0
|
|
|
|
|
|
return 0; |
|
105
|
|
|
|
|
|
|
}; |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub parseNormal { |
|
108
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
109
|
|
|
|
|
|
|
# String => 'keywords' |
|
110
|
|
|
|
|
|
|
# attribute => 'Keyword' |
|
111
|
|
|
|
|
|
|
# context => '#stay' |
|
112
|
|
|
|
|
|
|
# type => 'keyword' |
|
113
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { |
|
114
|
0
|
|
|
|
|
|
return 1 |
|
115
|
|
|
|
|
|
|
} |
|
116
|
|
|
|
|
|
|
# String => 'types' |
|
117
|
|
|
|
|
|
|
# attribute => 'Data' |
|
118
|
|
|
|
|
|
|
# context => '#stay' |
|
119
|
|
|
|
|
|
|
# type => 'keyword' |
|
120
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data')) { |
|
121
|
0
|
|
|
|
|
|
return 1 |
|
122
|
|
|
|
|
|
|
} |
|
123
|
|
|
|
|
|
|
# String => '%\w*' |
|
124
|
|
|
|
|
|
|
# attribute => 'Red' |
|
125
|
|
|
|
|
|
|
# context => '#stay' |
|
126
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
127
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '%\\w*', 0, 0, 0, undef, 0, '#stay', 'Red')) { |
|
128
|
0
|
|
|
|
|
|
return 1 |
|
129
|
|
|
|
|
|
|
} |
|
130
|
|
|
|
|
|
|
# attribute => 'Comment' |
|
131
|
|
|
|
|
|
|
# char => '#' |
|
132
|
|
|
|
|
|
|
# context => 'Comment' |
|
133
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
134
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { |
|
135
|
0
|
|
|
|
|
|
return 1 |
|
136
|
|
|
|
|
|
|
} |
|
137
|
|
|
|
|
|
|
# String => '\{\w*' |
|
138
|
|
|
|
|
|
|
# attribute => 'Keyword' |
|
139
|
|
|
|
|
|
|
# context => 'Some Context' |
|
140
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
141
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\{\\w*', 0, 0, 0, undef, 0, 'Some Context', 'Keyword')) { |
|
142
|
0
|
|
|
|
|
|
return 1 |
|
143
|
|
|
|
|
|
|
} |
|
144
|
|
|
|
|
|
|
# String => '<\s*[\w@\.]*' |
|
145
|
|
|
|
|
|
|
# attribute => 'Blue' |
|
146
|
|
|
|
|
|
|
# context => 'Some Context2' |
|
147
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
148
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '<\\s*[\\w@\\.]*', 0, 0, 0, undef, 0, 'Some Context2', 'Blue')) { |
|
149
|
0
|
|
|
|
|
|
return 1 |
|
150
|
|
|
|
|
|
|
} |
|
151
|
|
|
|
|
|
|
# String => '\$\w*' |
|
152
|
|
|
|
|
|
|
# attribute => 'Data' |
|
153
|
|
|
|
|
|
|
# context => '#stay' |
|
154
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
155
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\$\\w*', 0, 0, 0, undef, 0, '#stay', 'Data')) { |
|
156
|
0
|
|
|
|
|
|
return 1 |
|
157
|
|
|
|
|
|
|
} |
|
158
|
|
|
|
|
|
|
# String => '(Source|Patch)\d*' |
|
159
|
|
|
|
|
|
|
# attribute => 'Keyword' |
|
160
|
|
|
|
|
|
|
# context => '#stay' |
|
161
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
162
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '(Source|Patch)\\d*', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { |
|
163
|
0
|
|
|
|
|
|
return 1 |
|
164
|
|
|
|
|
|
|
} |
|
165
|
|
|
|
|
|
|
# String => '\*.*' |
|
166
|
|
|
|
|
|
|
# attribute => 'Keyword' |
|
167
|
|
|
|
|
|
|
# context => '#stay' |
|
168
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
|
169
|
|
|
|
|
|
|
# type => 'RegExpr' |
|
170
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '\\*.*', 0, 0, 0, undef, 1, '#stay', 'Keyword')) { |
|
171
|
0
|
|
|
|
|
|
return 1 |
|
172
|
|
|
|
|
|
|
} |
|
173
|
|
|
|
|
|
|
# attribute => 'Blue' |
|
174
|
|
|
|
|
|
|
# context => '#stay' |
|
175
|
|
|
|
|
|
|
# type => 'Int' |
|
176
|
0
|
0
|
|
|
|
|
if ($self->testInt($text, 0, undef, 0, '#stay', 'Blue')) { |
|
177
|
0
|
|
|
|
|
|
return 1 |
|
178
|
|
|
|
|
|
|
} |
|
179
|
0
|
|
|
|
|
|
return 0; |
|
180
|
|
|
|
|
|
|
}; |
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
sub parseSomeContext { |
|
183
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
184
|
|
|
|
|
|
|
# attribute => 'Keyword' |
|
185
|
|
|
|
|
|
|
# char => '}' |
|
186
|
|
|
|
|
|
|
# context => '#pop' |
|
187
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
188
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { |
|
189
|
0
|
|
|
|
|
|
return 1 |
|
190
|
|
|
|
|
|
|
} |
|
191
|
0
|
|
|
|
|
|
return 0; |
|
192
|
|
|
|
|
|
|
}; |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
sub parseSomeContext2 { |
|
195
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
|
196
|
|
|
|
|
|
|
# attribute => 'Blue' |
|
197
|
|
|
|
|
|
|
# char => '>' |
|
198
|
|
|
|
|
|
|
# context => '#pop' |
|
199
|
|
|
|
|
|
|
# type => 'DetectChar' |
|
200
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Blue')) { |
|
201
|
0
|
|
|
|
|
|
return 1 |
|
202
|
|
|
|
|
|
|
} |
|
203
|
0
|
|
|
|
|
|
return 0; |
|
204
|
|
|
|
|
|
|
}; |
|
205
|
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
1; |
|
208
|
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
__END__ |