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 'abc.xml' file of the syntax highlight |
6
|
|
|
|
|
|
|
# engine of the kate text editor (http://www.kate-editor.org |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#kate xml version 1.10 |
9
|
|
|
|
|
|
|
#kate version 2.4 |
10
|
|
|
|
|
|
|
#kate author Andrea Primiani (primiani@dag.it) |
11
|
|
|
|
|
|
|
#generated: Sun Feb 3 22:02:04 2008, localtime |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
package Syntax::Highlight::Engine::Kate::ABC; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = '0.07'; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
753
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
18
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
30
|
|
19
|
1
|
|
|
1
|
|
4
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
877
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
2
|
|
|
2
|
0
|
462
|
my $proto = shift; |
23
|
2
|
|
33
|
|
|
12
|
my $class = ref($proto) || $proto; |
24
|
2
|
|
|
|
|
14
|
my $self = $class->SUPER::new(@_); |
25
|
2
|
|
|
|
|
26
|
$self->attributes({ |
26
|
|
|
|
|
|
|
'Bar' => 'Char', |
27
|
|
|
|
|
|
|
'Comment' => 'Comment', |
28
|
|
|
|
|
|
|
'Decoration' => 'Float', |
29
|
|
|
|
|
|
|
'Header' => 'Float', |
30
|
|
|
|
|
|
|
'Lyrics' => 'DataType', |
31
|
|
|
|
|
|
|
'Normal Text' => 'Normal', |
32
|
|
|
|
|
|
|
'Notes' => 'Keyword', |
33
|
|
|
|
|
|
|
'Preprocessor' => 'String', |
34
|
|
|
|
|
|
|
'Sharp' => 'Normal', |
35
|
|
|
|
|
|
|
'Slur' => 'DataType', |
36
|
|
|
|
|
|
|
'String' => 'String', |
37
|
|
|
|
|
|
|
'Tuplet' => 'DataType', |
38
|
|
|
|
|
|
|
}); |
39
|
2
|
|
|
|
|
40
|
$self->contextdata({ |
40
|
|
|
|
|
|
|
'Bar' => { |
41
|
|
|
|
|
|
|
callback => \&parseBar, |
42
|
|
|
|
|
|
|
attribute => 'Bar', |
43
|
|
|
|
|
|
|
lineending => '#pop', |
44
|
|
|
|
|
|
|
}, |
45
|
|
|
|
|
|
|
'Comment' => { |
46
|
|
|
|
|
|
|
callback => \&parseComment, |
47
|
|
|
|
|
|
|
attribute => 'Comment', |
48
|
|
|
|
|
|
|
lineending => '#pop', |
49
|
|
|
|
|
|
|
}, |
50
|
|
|
|
|
|
|
'Header' => { |
51
|
|
|
|
|
|
|
callback => \&parseHeader, |
52
|
|
|
|
|
|
|
attribute => 'Header', |
53
|
|
|
|
|
|
|
}, |
54
|
|
|
|
|
|
|
'Header2' => { |
55
|
|
|
|
|
|
|
callback => \&parseHeader2, |
56
|
|
|
|
|
|
|
attribute => 'Header', |
57
|
|
|
|
|
|
|
lineending => '#pop', |
58
|
|
|
|
|
|
|
}, |
59
|
|
|
|
|
|
|
'Lyrics' => { |
60
|
|
|
|
|
|
|
callback => \&parseLyrics, |
61
|
|
|
|
|
|
|
attribute => 'Lyrics', |
62
|
|
|
|
|
|
|
lineending => '#pop', |
63
|
|
|
|
|
|
|
}, |
64
|
|
|
|
|
|
|
'Normal' => { |
65
|
|
|
|
|
|
|
callback => \&parseNormal, |
66
|
|
|
|
|
|
|
attribute => 'Normal Text', |
67
|
|
|
|
|
|
|
}, |
68
|
|
|
|
|
|
|
'Part' => { |
69
|
|
|
|
|
|
|
callback => \&parsePart, |
70
|
|
|
|
|
|
|
attribute => 'Header', |
71
|
|
|
|
|
|
|
lineending => '#pop', |
72
|
|
|
|
|
|
|
}, |
73
|
|
|
|
|
|
|
'Preprocessor' => { |
74
|
|
|
|
|
|
|
callback => \&parsePreprocessor, |
75
|
|
|
|
|
|
|
attribute => 'Preprocessor', |
76
|
|
|
|
|
|
|
lineending => '#pop', |
77
|
|
|
|
|
|
|
}, |
78
|
|
|
|
|
|
|
}); |
79
|
2
|
|
|
|
|
12
|
$self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
80
|
2
|
|
|
|
|
8
|
$self->basecontext('Normal'); |
81
|
2
|
|
|
|
|
11
|
$self->keywordscase(0); |
82
|
2
|
|
|
|
|
5
|
$self->initialize; |
83
|
2
|
|
|
|
|
6
|
bless ($self, $class); |
84
|
2
|
|
|
|
|
12
|
return $self; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub language { |
88
|
0
|
|
|
0
|
0
|
0
|
return 'ABC'; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub parseBar { |
92
|
42
|
|
|
42
|
0
|
69
|
my ($self, $text) = @_; |
93
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
94
|
|
|
|
|
|
|
# char => '"' |
95
|
|
|
|
|
|
|
# context => '#pop' |
96
|
|
|
|
|
|
|
# type => 'DetectChar' |
97
|
42
|
50
|
|
|
|
156
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
98
|
0
|
|
|
|
|
0
|
return 1 |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
# String => '[A-Ga-gZz]' |
101
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
102
|
|
|
|
|
|
|
# context => '#pop' |
103
|
|
|
|
|
|
|
# type => 'RegExpr' |
104
|
42
|
100
|
|
|
|
143
|
if ($self->testRegExpr($text, '[A-Ga-gZz]', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
105
|
36
|
|
|
|
|
98
|
return 1 |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
108
|
|
|
|
|
|
|
# char => ' ' |
109
|
|
|
|
|
|
|
# context => '#pop' |
110
|
|
|
|
|
|
|
# type => 'DetectChar' |
111
|
6
|
50
|
|
|
|
24
|
if ($self->testDetectChar($text, ' ', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
112
|
0
|
|
|
|
|
0
|
return 1 |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
# attribute => 'Decoration' |
115
|
|
|
|
|
|
|
# char => '!' |
116
|
|
|
|
|
|
|
# char1 => '!' |
117
|
|
|
|
|
|
|
# context => '#stay' |
118
|
|
|
|
|
|
|
# type => 'RangeDetect' |
119
|
6
|
50
|
|
|
|
21
|
if ($self->testRangeDetect($text, '!', '!', 0, 0, undef, 0, '#stay', 'Decoration')) { |
120
|
0
|
|
|
|
|
0
|
return 1 |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
# String => '()' |
123
|
|
|
|
|
|
|
# attribute => 'Slur' |
124
|
|
|
|
|
|
|
# context => '#stay' |
125
|
|
|
|
|
|
|
# type => 'AnyChar' |
126
|
6
|
50
|
|
|
|
23
|
if ($self->testAnyChar($text, '()', 0, 0, undef, 0, '#stay', 'Slur')) { |
127
|
0
|
|
|
|
|
0
|
return 1 |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
# String => ':*\|*[1-9]|/*\|' |
130
|
|
|
|
|
|
|
# attribute => 'Bar' |
131
|
|
|
|
|
|
|
# context => '#pop' |
132
|
|
|
|
|
|
|
# type => 'RegExpr' |
133
|
6
|
50
|
|
|
|
20
|
if ($self->testRegExpr($text, ':*\\|*[1-9]|/*\\|', 0, 0, 0, undef, 0, '#pop', 'Bar')) { |
134
|
6
|
|
|
|
|
17
|
return 1 |
135
|
|
|
|
|
|
|
} |
136
|
0
|
|
|
|
|
0
|
return 0; |
137
|
|
|
|
|
|
|
}; |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub parseComment { |
140
|
114
|
|
|
114
|
0
|
191
|
my ($self, $text) = @_; |
141
|
114
|
|
|
|
|
251
|
return 0; |
142
|
|
|
|
|
|
|
}; |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
sub parseHeader { |
145
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
146
|
|
|
|
|
|
|
# String => 'K:.+' |
147
|
|
|
|
|
|
|
# attribute => 'Header' |
148
|
|
|
|
|
|
|
# column => '0' |
149
|
|
|
|
|
|
|
# context => '#pop' |
150
|
|
|
|
|
|
|
# endRegion => 'header' |
151
|
|
|
|
|
|
|
# type => 'RegExpr' |
152
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, 'K:.+', 0, 0, 0, 0, 0, '#pop', 'Header')) { |
153
|
0
|
|
|
|
|
0
|
return 1 |
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
# attribute => 'Header' |
156
|
|
|
|
|
|
|
# char => ']' |
157
|
|
|
|
|
|
|
# context => '#pop' |
158
|
|
|
|
|
|
|
# type => 'DetectChar' |
159
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Header')) { |
160
|
0
|
|
|
|
|
0
|
return 1 |
161
|
|
|
|
|
|
|
} |
162
|
0
|
|
|
|
|
0
|
return 0; |
163
|
|
|
|
|
|
|
}; |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
sub parseHeader2 { |
166
|
98
|
|
|
98
|
0
|
137
|
my ($self, $text) = @_; |
167
|
98
|
|
|
|
|
221
|
return 0; |
168
|
|
|
|
|
|
|
}; |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
sub parseLyrics { |
171
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
172
|
0
|
|
|
|
|
0
|
return 0; |
173
|
|
|
|
|
|
|
}; |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
sub parseNormal { |
176
|
342
|
|
|
342
|
0
|
471
|
my ($self, $text) = @_; |
177
|
|
|
|
|
|
|
# String => '\([23456789]:?[23456789]?:?[23456789]?' |
178
|
|
|
|
|
|
|
# attribute => 'Tuplet' |
179
|
|
|
|
|
|
|
# context => '#stay' |
180
|
|
|
|
|
|
|
# type => 'RegExpr' |
181
|
342
|
50
|
|
|
|
1039
|
if ($self->testRegExpr($text, '\\([23456789]:?[23456789]?:?[23456789]?', 0, 0, 0, undef, 0, '#stay', 'Tuplet')) { |
182
|
0
|
|
|
|
|
0
|
return 1 |
183
|
|
|
|
|
|
|
} |
184
|
|
|
|
|
|
|
# attribute => 'String' |
185
|
|
|
|
|
|
|
# char => '"' |
186
|
|
|
|
|
|
|
# char1 => '"' |
187
|
|
|
|
|
|
|
# context => '#stay' |
188
|
|
|
|
|
|
|
# type => 'RangeDetect' |
189
|
342
|
50
|
|
|
|
1212
|
if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'String')) { |
190
|
0
|
|
|
|
|
0
|
return 1 |
191
|
|
|
|
|
|
|
} |
192
|
|
|
|
|
|
|
# attribute => 'Decoration' |
193
|
|
|
|
|
|
|
# char => '!' |
194
|
|
|
|
|
|
|
# char1 => '!' |
195
|
|
|
|
|
|
|
# context => '#stay' |
196
|
|
|
|
|
|
|
# type => 'RangeDetect' |
197
|
342
|
50
|
|
|
|
1036
|
if ($self->testRangeDetect($text, '!', '!', 0, 0, undef, 0, '#stay', 'Decoration')) { |
198
|
0
|
|
|
|
|
0
|
return 1 |
199
|
|
|
|
|
|
|
} |
200
|
|
|
|
|
|
|
# String => '\[[ABCGHILMNOQRSTUVZ]:' |
201
|
|
|
|
|
|
|
# attribute => 'Header' |
202
|
|
|
|
|
|
|
# context => 'Header' |
203
|
|
|
|
|
|
|
# type => 'RegExpr' |
204
|
342
|
50
|
|
|
|
1148
|
if ($self->testRegExpr($text, '\\[[ABCGHILMNOQRSTUVZ]:', 0, 0, 0, undef, 0, 'Header', 'Header')) { |
205
|
0
|
|
|
|
|
0
|
return 1 |
206
|
|
|
|
|
|
|
} |
207
|
|
|
|
|
|
|
# String => '[ABCGHILMNOPQRSTUVZ]:' |
208
|
|
|
|
|
|
|
# attribute => 'Header' |
209
|
|
|
|
|
|
|
# context => 'Header2' |
210
|
|
|
|
|
|
|
# type => 'RegExpr' |
211
|
342
|
100
|
|
|
|
1079
|
if ($self->testRegExpr($text, '[ABCGHILMNOPQRSTUVZ]:', 0, 0, 0, undef, 0, 'Header2', 'Header')) { |
212
|
12
|
|
|
|
|
38
|
return 1 |
213
|
|
|
|
|
|
|
} |
214
|
|
|
|
|
|
|
# attribute => 'Header' |
215
|
|
|
|
|
|
|
# beginRegion => 'header' |
216
|
|
|
|
|
|
|
# char => 'X' |
217
|
|
|
|
|
|
|
# char1 => ':' |
218
|
|
|
|
|
|
|
# column => '0' |
219
|
|
|
|
|
|
|
# context => 'Header' |
220
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
221
|
330
|
50
|
|
|
|
1191
|
if ($self->testDetect2Chars($text, 'X', ':', 0, 0, 0, 0, 0, 'Header', 'Header')) { |
222
|
0
|
|
|
|
|
0
|
return 1 |
223
|
|
|
|
|
|
|
} |
224
|
|
|
|
|
|
|
# String => '|:[' |
225
|
|
|
|
|
|
|
# attribute => 'Bar' |
226
|
|
|
|
|
|
|
# context => 'Bar' |
227
|
|
|
|
|
|
|
# type => 'AnyChar' |
228
|
330
|
100
|
|
|
|
1122
|
if ($self->testAnyChar($text, '|:[', 0, 0, undef, 0, 'Bar', 'Bar')) { |
229
|
42
|
|
|
|
|
102
|
return 1 |
230
|
|
|
|
|
|
|
} |
231
|
|
|
|
|
|
|
# attribute => 'Bar' |
232
|
|
|
|
|
|
|
# char => ']' |
233
|
|
|
|
|
|
|
# context => '#stay' |
234
|
|
|
|
|
|
|
# type => 'DetectChar' |
235
|
288
|
50
|
|
|
|
811
|
if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#stay', 'Bar')) { |
236
|
0
|
|
|
|
|
0
|
return 1 |
237
|
|
|
|
|
|
|
} |
238
|
|
|
|
|
|
|
# String => '()' |
239
|
|
|
|
|
|
|
# attribute => 'Slur' |
240
|
|
|
|
|
|
|
# context => '#stay' |
241
|
|
|
|
|
|
|
# type => 'AnyChar' |
242
|
288
|
50
|
|
|
|
826
|
if ($self->testAnyChar($text, '()', 0, 0, undef, 0, '#stay', 'Slur')) { |
243
|
0
|
|
|
|
|
0
|
return 1 |
244
|
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
# String => '{}' |
246
|
|
|
|
|
|
|
# attribute => 'Slur' |
247
|
|
|
|
|
|
|
# context => '#stay' |
248
|
|
|
|
|
|
|
# type => 'AnyChar' |
249
|
288
|
50
|
|
|
|
827
|
if ($self->testAnyChar($text, '{}', 0, 0, undef, 0, '#stay', 'Slur')) { |
250
|
0
|
|
|
|
|
0
|
return 1 |
251
|
|
|
|
|
|
|
} |
252
|
|
|
|
|
|
|
# attribute => 'Lyrics' |
253
|
|
|
|
|
|
|
# char => 'W' |
254
|
|
|
|
|
|
|
# char1 => ':' |
255
|
|
|
|
|
|
|
# context => 'Lyrics' |
256
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
257
|
288
|
50
|
|
|
|
834
|
if ($self->testDetect2Chars($text, 'W', ':', 0, 0, 0, undef, 0, 'Lyrics', 'Lyrics')) { |
258
|
0
|
|
|
|
|
0
|
return 1 |
259
|
|
|
|
|
|
|
} |
260
|
|
|
|
|
|
|
# attribute => 'Lyrics' |
261
|
|
|
|
|
|
|
# char => 'w' |
262
|
|
|
|
|
|
|
# char1 => ':' |
263
|
|
|
|
|
|
|
# context => 'Lyrics' |
264
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
265
|
288
|
50
|
|
|
|
796
|
if ($self->testDetect2Chars($text, 'w', ':', 0, 0, 0, undef, 0, 'Lyrics', 'Lyrics')) { |
266
|
0
|
|
|
|
|
0
|
return 1 |
267
|
|
|
|
|
|
|
} |
268
|
|
|
|
|
|
|
# attribute => 'Preprocessor' |
269
|
|
|
|
|
|
|
# char => '%' |
270
|
|
|
|
|
|
|
# char1 => '%' |
271
|
|
|
|
|
|
|
# context => 'Preprocessor' |
272
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
273
|
288
|
50
|
|
|
|
796
|
if ($self->testDetect2Chars($text, '%', '%', 0, 0, 0, undef, 0, 'Preprocessor', 'Preprocessor')) { |
274
|
0
|
|
|
|
|
0
|
return 1 |
275
|
|
|
|
|
|
|
} |
276
|
|
|
|
|
|
|
# attribute => 'Comment' |
277
|
|
|
|
|
|
|
# char => '%' |
278
|
|
|
|
|
|
|
# context => 'Comment' |
279
|
|
|
|
|
|
|
# type => 'DetectChar' |
280
|
288
|
100
|
|
|
|
814
|
if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { |
281
|
2
|
|
|
|
|
8
|
return 1 |
282
|
|
|
|
|
|
|
} |
283
|
|
|
|
|
|
|
# String => '[_|\^]?[_|=|\^][A-Ga-g]' |
284
|
|
|
|
|
|
|
# attribute => 'Sharp' |
285
|
|
|
|
|
|
|
# context => '#stay' |
286
|
|
|
|
|
|
|
# type => 'RegExpr' |
287
|
286
|
50
|
|
|
|
846
|
if ($self->testRegExpr($text, '[_|\\^]?[_|=|\\^][A-Ga-g]', 0, 0, 0, undef, 0, '#stay', 'Sharp')) { |
288
|
0
|
|
|
|
|
0
|
return 1 |
289
|
|
|
|
|
|
|
} |
290
|
286
|
|
|
|
|
805
|
return 0; |
291
|
|
|
|
|
|
|
}; |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
sub parsePart { |
294
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
295
|
0
|
|
|
|
|
|
return 0; |
296
|
|
|
|
|
|
|
}; |
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
sub parsePreprocessor { |
299
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
300
|
0
|
|
|
|
|
|
return 0; |
301
|
|
|
|
|
|
|
}; |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
1; |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
__END__ |