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.12'; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
485
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
18
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
19
|
1
|
|
|
1
|
|
5
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
711
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
2
|
|
|
2
|
0
|
511
|
my $proto = shift; |
23
|
2
|
|
33
|
|
|
10
|
my $class = ref($proto) || $proto; |
24
|
2
|
|
|
|
|
10
|
my $self = $class->SUPER::new(@_); |
25
|
2
|
|
|
|
|
22
|
$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
|
|
|
|
|
33
|
$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
|
|
|
|
|
8
|
$self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
80
|
2
|
|
|
|
|
6
|
$self->basecontext('Normal'); |
81
|
2
|
|
|
|
|
7
|
$self->keywordscase(0); |
82
|
2
|
|
|
|
|
6
|
$self->initialize; |
83
|
2
|
|
|
|
|
2
|
bless ($self, $class); |
84
|
2
|
|
|
|
|
11
|
return $self; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub language { |
88
|
0
|
|
|
0
|
0
|
0
|
return 'ABC'; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub parseBar { |
92
|
42
|
|
|
42
|
0
|
100
|
my ($self, $text) = @_; |
93
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
94
|
|
|
|
|
|
|
# char => '"' |
95
|
|
|
|
|
|
|
# context => '#pop' |
96
|
|
|
|
|
|
|
# type => 'DetectChar' |
97
|
42
|
50
|
|
|
|
145
|
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
|
|
|
|
140
|
if ($self->testRegExpr($text, '[A-Ga-gZz]', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
105
|
36
|
|
|
|
|
87
|
return 1 |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
108
|
|
|
|
|
|
|
# char => ' ' |
109
|
|
|
|
|
|
|
# context => '#pop' |
110
|
|
|
|
|
|
|
# type => 'DetectChar' |
111
|
6
|
50
|
|
|
|
31
|
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
|
|
|
|
24
|
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
|
|
|
|
27
|
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
|
|
|
|
24
|
if ($self->testRegExpr($text, ':*\\|*[1-9]|/*\\|', 0, 0, 0, undef, 0, '#pop', 'Bar')) { |
134
|
6
|
|
|
|
|
18
|
return 1 |
135
|
|
|
|
|
|
|
} |
136
|
0
|
|
|
|
|
0
|
return 0; |
137
|
|
|
|
|
|
|
}; |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub parseComment { |
140
|
114
|
|
|
114
|
0
|
169
|
my ($self, $text) = @_; |
141
|
114
|
|
|
|
|
197
|
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
|
168
|
my ($self, $text) = @_; |
167
|
98
|
|
|
|
|
183
|
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
|
601
|
my ($self, $text) = @_; |
177
|
|
|
|
|
|
|
# String => '\([23456789]:?[23456789]?:?[23456789]?' |
178
|
|
|
|
|
|
|
# attribute => 'Tuplet' |
179
|
|
|
|
|
|
|
# context => '#stay' |
180
|
|
|
|
|
|
|
# type => 'RegExpr' |
181
|
342
|
50
|
|
|
|
867
|
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
|
|
|
|
1033
|
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
|
|
|
|
920
|
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
|
|
|
|
914
|
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
|
|
|
|
931
|
if ($self->testRegExpr($text, '[ABCGHILMNOPQRSTUVZ]:', 0, 0, 0, undef, 0, 'Header2', 'Header')) { |
212
|
12
|
|
|
|
|
31
|
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
|
|
|
|
907
|
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
|
|
|
|
848
|
if ($self->testAnyChar($text, '|:[', 0, 0, undef, 0, 'Bar', 'Bar')) { |
229
|
42
|
|
|
|
|
98
|
return 1 |
230
|
|
|
|
|
|
|
} |
231
|
|
|
|
|
|
|
# attribute => 'Bar' |
232
|
|
|
|
|
|
|
# char => ']' |
233
|
|
|
|
|
|
|
# context => '#stay' |
234
|
|
|
|
|
|
|
# type => 'DetectChar' |
235
|
288
|
50
|
|
|
|
688
|
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
|
|
|
|
697
|
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
|
|
|
|
697
|
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
|
|
|
|
665
|
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
|
|
|
|
690
|
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
|
|
|
|
687
|
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
|
|
|
|
678
|
if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { |
281
|
2
|
|
|
|
|
6
|
return 1 |
282
|
|
|
|
|
|
|
} |
283
|
|
|
|
|
|
|
# String => '[_|\^]?[_|=|\^][A-Ga-g]' |
284
|
|
|
|
|
|
|
# attribute => 'Sharp' |
285
|
|
|
|
|
|
|
# context => '#stay' |
286
|
|
|
|
|
|
|
# type => 'RegExpr' |
287
|
286
|
50
|
|
|
|
768
|
if ($self->testRegExpr($text, '[_|\\^]?[_|=|\\^][A-Ga-g]', 0, 0, 0, undef, 0, '#stay', 'Sharp')) { |
288
|
0
|
|
|
|
|
0
|
return 1 |
289
|
|
|
|
|
|
|
} |
290
|
286
|
|
|
|
|
642
|
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__ |