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 'ferite.xml' file of the syntax highlight |
6
|
|
|
|
|
|
|
# engine of the kate text editor (http://www.kate-editor.org |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#kate xml version 1.04 |
9
|
|
|
|
|
|
|
#kate version 2.4 |
10
|
|
|
|
|
|
|
#generated: Sun Feb 3 22:02:04 2008, localtime |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Syntax::Highlight::Engine::Kate::Ferite; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.14'; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
456
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
23
|
|
17
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
18
|
1
|
|
|
1
|
|
4
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1025
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
1
|
|
|
1
|
0
|
530
|
my $proto = shift; |
22
|
1
|
|
33
|
|
|
6
|
my $class = ref($proto) || $proto; |
23
|
1
|
|
|
|
|
6
|
my $self = $class->SUPER::new(@_); |
24
|
1
|
|
|
|
|
10
|
$self->attributes({ |
25
|
|
|
|
|
|
|
'Alert' => 'Alert', |
26
|
|
|
|
|
|
|
'Char' => 'Char', |
27
|
|
|
|
|
|
|
'Comment' => 'Comment', |
28
|
|
|
|
|
|
|
'Data Type' => 'DataType', |
29
|
|
|
|
|
|
|
'Decimal' => 'DecVal', |
30
|
|
|
|
|
|
|
'Float' => 'Float', |
31
|
|
|
|
|
|
|
'Hex' => 'BaseN', |
32
|
|
|
|
|
|
|
'Keyword' => 'Keyword', |
33
|
|
|
|
|
|
|
'Normal Text' => 'Normal', |
34
|
|
|
|
|
|
|
'Octal' => 'BaseN', |
35
|
|
|
|
|
|
|
'Prep. Lib' => 'Others', |
36
|
|
|
|
|
|
|
'Preprocessor' => 'Others', |
37
|
|
|
|
|
|
|
'String' => 'String', |
38
|
|
|
|
|
|
|
'String Char' => 'Char', |
39
|
|
|
|
|
|
|
'Symbol' => 'Normal', |
40
|
|
|
|
|
|
|
}); |
41
|
1
|
|
|
|
|
5
|
$self->listAdd('keywords', |
42
|
|
|
|
|
|
|
'break', |
43
|
|
|
|
|
|
|
'case', |
44
|
|
|
|
|
|
|
'class', |
45
|
|
|
|
|
|
|
'continue', |
46
|
|
|
|
|
|
|
'do', |
47
|
|
|
|
|
|
|
'else', |
48
|
|
|
|
|
|
|
'fix', |
49
|
|
|
|
|
|
|
'for', |
50
|
|
|
|
|
|
|
'function', |
51
|
|
|
|
|
|
|
'global', |
52
|
|
|
|
|
|
|
'if', |
53
|
|
|
|
|
|
|
'iferr', |
54
|
|
|
|
|
|
|
'namespace', |
55
|
|
|
|
|
|
|
'new', |
56
|
|
|
|
|
|
|
'null', |
57
|
|
|
|
|
|
|
'return', |
58
|
|
|
|
|
|
|
'self', |
59
|
|
|
|
|
|
|
'super', |
60
|
|
|
|
|
|
|
'uses', |
61
|
|
|
|
|
|
|
'while', |
62
|
|
|
|
|
|
|
); |
63
|
1
|
|
|
|
|
3
|
$self->listAdd('types', |
64
|
|
|
|
|
|
|
'array', |
65
|
|
|
|
|
|
|
'final', |
66
|
|
|
|
|
|
|
'number', |
67
|
|
|
|
|
|
|
'object', |
68
|
|
|
|
|
|
|
'static', |
69
|
|
|
|
|
|
|
'string', |
70
|
|
|
|
|
|
|
'void', |
71
|
|
|
|
|
|
|
); |
72
|
1
|
|
|
|
|
14
|
$self->contextdata({ |
73
|
|
|
|
|
|
|
'Comment' => { |
74
|
|
|
|
|
|
|
callback => \&parseComment, |
75
|
|
|
|
|
|
|
attribute => 'Comment', |
76
|
|
|
|
|
|
|
lineending => '#pop', |
77
|
|
|
|
|
|
|
}, |
78
|
|
|
|
|
|
|
'Default' => { |
79
|
|
|
|
|
|
|
callback => \&parseDefault, |
80
|
|
|
|
|
|
|
attribute => 'Normal Text', |
81
|
|
|
|
|
|
|
}, |
82
|
|
|
|
|
|
|
'Multiline Comment' => { |
83
|
|
|
|
|
|
|
callback => \&parseMultilineComment, |
84
|
|
|
|
|
|
|
attribute => 'Comment', |
85
|
|
|
|
|
|
|
}, |
86
|
|
|
|
|
|
|
'Multiline Comment 2' => { |
87
|
|
|
|
|
|
|
callback => \&parseMultilineComment2, |
88
|
|
|
|
|
|
|
attribute => 'Comment', |
89
|
|
|
|
|
|
|
}, |
90
|
|
|
|
|
|
|
'Preprocessor' => { |
91
|
|
|
|
|
|
|
callback => \&parsePreprocessor, |
92
|
|
|
|
|
|
|
attribute => 'Preprocessor', |
93
|
|
|
|
|
|
|
lineending => '#pop', |
94
|
|
|
|
|
|
|
}, |
95
|
|
|
|
|
|
|
'String' => { |
96
|
|
|
|
|
|
|
callback => \&parseString, |
97
|
|
|
|
|
|
|
attribute => 'String', |
98
|
|
|
|
|
|
|
lineending => '#pop', |
99
|
|
|
|
|
|
|
}, |
100
|
|
|
|
|
|
|
'Undeffed' => { |
101
|
|
|
|
|
|
|
callback => \&parseUndeffed, |
102
|
|
|
|
|
|
|
attribute => 'Comment', |
103
|
|
|
|
|
|
|
}, |
104
|
|
|
|
|
|
|
'unknown' => { |
105
|
|
|
|
|
|
|
callback => \&parseunknown, |
106
|
|
|
|
|
|
|
attribute => 'Normal Text', |
107
|
|
|
|
|
|
|
lineending => '#pop', |
108
|
|
|
|
|
|
|
}, |
109
|
|
|
|
|
|
|
'unknown 2' => { |
110
|
|
|
|
|
|
|
callback => \&parseunknown2, |
111
|
|
|
|
|
|
|
attribute => 'Normal Text', |
112
|
|
|
|
|
|
|
lineending => '#pop', |
113
|
|
|
|
|
|
|
}, |
114
|
|
|
|
|
|
|
}); |
115
|
1
|
|
|
|
|
4
|
$self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
116
|
1
|
|
|
|
|
4
|
$self->basecontext('Default'); |
117
|
1
|
|
|
|
|
4
|
$self->keywordscase(0); |
118
|
1
|
|
|
|
|
3
|
$self->initialize; |
119
|
1
|
|
|
|
|
2
|
bless ($self, $class); |
120
|
1
|
|
|
|
|
3
|
return $self; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
sub language { |
124
|
0
|
|
|
0
|
0
|
|
return 'ferite'; |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
sub parseComment { |
128
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
129
|
|
|
|
|
|
|
# String => '(FIXME|TODO)' |
130
|
|
|
|
|
|
|
# attribute => 'Alert' |
131
|
|
|
|
|
|
|
# context => '#stay' |
132
|
|
|
|
|
|
|
# type => 'RegExpr' |
133
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) { |
134
|
0
|
|
|
|
|
|
return 1 |
135
|
|
|
|
|
|
|
} |
136
|
0
|
|
|
|
|
|
return 0; |
137
|
|
|
|
|
|
|
}; |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub parseDefault { |
140
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
141
|
|
|
|
|
|
|
# String => 'keywords' |
142
|
|
|
|
|
|
|
# attribute => 'Keyword' |
143
|
|
|
|
|
|
|
# context => '#stay' |
144
|
|
|
|
|
|
|
# type => 'keyword' |
145
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { |
146
|
0
|
|
|
|
|
|
return 1 |
147
|
|
|
|
|
|
|
} |
148
|
|
|
|
|
|
|
# String => 'types' |
149
|
|
|
|
|
|
|
# attribute => 'Data Type' |
150
|
|
|
|
|
|
|
# context => '#stay' |
151
|
|
|
|
|
|
|
# type => 'keyword' |
152
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { |
153
|
0
|
|
|
|
|
|
return 1 |
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
# attribute => 'Float' |
156
|
|
|
|
|
|
|
# context => '#stay' |
157
|
|
|
|
|
|
|
# items => 'ARRAY(0xfd97c0)' |
158
|
|
|
|
|
|
|
# type => 'Float' |
159
|
0
|
0
|
|
|
|
|
if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { |
160
|
|
|
|
|
|
|
# String => 'fF' |
161
|
|
|
|
|
|
|
# attribute => 'Float' |
162
|
|
|
|
|
|
|
# context => '#stay' |
163
|
|
|
|
|
|
|
# type => 'AnyChar' |
164
|
0
|
0
|
|
|
|
|
if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) { |
165
|
0
|
|
|
|
|
|
return 1 |
166
|
|
|
|
|
|
|
} |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
# attribute => 'Octal' |
169
|
|
|
|
|
|
|
# context => '#stay' |
170
|
|
|
|
|
|
|
# type => 'HlCOct' |
171
|
0
|
0
|
|
|
|
|
if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { |
172
|
0
|
|
|
|
|
|
return 1 |
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
# attribute => 'Hex' |
175
|
|
|
|
|
|
|
# context => '#stay' |
176
|
|
|
|
|
|
|
# type => 'HlCHex' |
177
|
0
|
0
|
|
|
|
|
if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { |
178
|
0
|
|
|
|
|
|
return 1 |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
# attribute => 'Decimal' |
181
|
|
|
|
|
|
|
# context => '#stay' |
182
|
|
|
|
|
|
|
# items => 'ARRAY(0x11bdd60)' |
183
|
|
|
|
|
|
|
# type => 'Int' |
184
|
0
|
0
|
|
|
|
|
if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { |
185
|
|
|
|
|
|
|
# String => 'ULL' |
186
|
|
|
|
|
|
|
# attribute => 'Decimal' |
187
|
|
|
|
|
|
|
# context => '#stay' |
188
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
189
|
|
|
|
|
|
|
# type => 'StringDetect' |
190
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { |
191
|
0
|
|
|
|
|
|
return 1 |
192
|
|
|
|
|
|
|
} |
193
|
|
|
|
|
|
|
# String => 'LUL' |
194
|
|
|
|
|
|
|
# attribute => 'Decimal' |
195
|
|
|
|
|
|
|
# context => '#stay' |
196
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
197
|
|
|
|
|
|
|
# type => 'StringDetect' |
198
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { |
199
|
0
|
|
|
|
|
|
return 1 |
200
|
|
|
|
|
|
|
} |
201
|
|
|
|
|
|
|
# String => 'LLU' |
202
|
|
|
|
|
|
|
# attribute => 'Decimal' |
203
|
|
|
|
|
|
|
# context => '#stay' |
204
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
205
|
|
|
|
|
|
|
# type => 'StringDetect' |
206
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { |
207
|
0
|
|
|
|
|
|
return 1 |
208
|
|
|
|
|
|
|
} |
209
|
|
|
|
|
|
|
# String => 'UL' |
210
|
|
|
|
|
|
|
# attribute => 'Decimal' |
211
|
|
|
|
|
|
|
# context => '#stay' |
212
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
213
|
|
|
|
|
|
|
# type => 'StringDetect' |
214
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { |
215
|
0
|
|
|
|
|
|
return 1 |
216
|
|
|
|
|
|
|
} |
217
|
|
|
|
|
|
|
# String => 'LU' |
218
|
|
|
|
|
|
|
# attribute => 'Decimal' |
219
|
|
|
|
|
|
|
# context => '#stay' |
220
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
221
|
|
|
|
|
|
|
# type => 'StringDetect' |
222
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { |
223
|
0
|
|
|
|
|
|
return 1 |
224
|
|
|
|
|
|
|
} |
225
|
|
|
|
|
|
|
# String => 'LL' |
226
|
|
|
|
|
|
|
# attribute => 'Decimal' |
227
|
|
|
|
|
|
|
# context => '#stay' |
228
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
229
|
|
|
|
|
|
|
# type => 'StringDetect' |
230
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { |
231
|
0
|
|
|
|
|
|
return 1 |
232
|
|
|
|
|
|
|
} |
233
|
|
|
|
|
|
|
# String => 'U' |
234
|
|
|
|
|
|
|
# attribute => 'Decimal' |
235
|
|
|
|
|
|
|
# context => '#stay' |
236
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
237
|
|
|
|
|
|
|
# type => 'StringDetect' |
238
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { |
239
|
0
|
|
|
|
|
|
return 1 |
240
|
|
|
|
|
|
|
} |
241
|
|
|
|
|
|
|
# String => 'L' |
242
|
|
|
|
|
|
|
# attribute => 'Decimal' |
243
|
|
|
|
|
|
|
# context => '#stay' |
244
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
245
|
|
|
|
|
|
|
# type => 'StringDetect' |
246
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { |
247
|
0
|
|
|
|
|
|
return 1 |
248
|
|
|
|
|
|
|
} |
249
|
|
|
|
|
|
|
} |
250
|
|
|
|
|
|
|
# attribute => 'Char' |
251
|
|
|
|
|
|
|
# context => '#stay' |
252
|
|
|
|
|
|
|
# type => 'HlCChar' |
253
|
0
|
0
|
|
|
|
|
if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { |
254
|
0
|
|
|
|
|
|
return 1 |
255
|
|
|
|
|
|
|
} |
256
|
|
|
|
|
|
|
# attribute => 'String' |
257
|
|
|
|
|
|
|
# char => '"' |
258
|
|
|
|
|
|
|
# context => 'String' |
259
|
|
|
|
|
|
|
# type => 'DetectChar' |
260
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { |
261
|
0
|
|
|
|
|
|
return 1 |
262
|
|
|
|
|
|
|
} |
263
|
|
|
|
|
|
|
# attribute => 'Comment' |
264
|
|
|
|
|
|
|
# char => '/' |
265
|
|
|
|
|
|
|
# char1 => '/' |
266
|
|
|
|
|
|
|
# context => 'Comment' |
267
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
268
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { |
269
|
0
|
|
|
|
|
|
return 1 |
270
|
|
|
|
|
|
|
} |
271
|
|
|
|
|
|
|
# attribute => 'Comment' |
272
|
|
|
|
|
|
|
# char => '/' |
273
|
|
|
|
|
|
|
# char1 => '*' |
274
|
|
|
|
|
|
|
# context => 'Multiline Comment' |
275
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
276
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Multiline Comment', 'Comment')) { |
277
|
0
|
|
|
|
|
|
return 1 |
278
|
|
|
|
|
|
|
} |
279
|
|
|
|
|
|
|
# String => '!%&()+,-<=>?[]^{|}~' |
280
|
|
|
|
|
|
|
# attribute => 'Symbol' |
281
|
|
|
|
|
|
|
# context => '#stay' |
282
|
|
|
|
|
|
|
# type => 'AnyChar' |
283
|
0
|
0
|
|
|
|
|
if ($self->testAnyChar($text, '!%&()+,-<=>?[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) { |
284
|
0
|
|
|
|
|
|
return 1 |
285
|
|
|
|
|
|
|
} |
286
|
|
|
|
|
|
|
# String => '#if 0' |
287
|
|
|
|
|
|
|
# attribute => 'Comment' |
288
|
|
|
|
|
|
|
# context => 'Undeffed' |
289
|
|
|
|
|
|
|
# insensitive => 'FALSE' |
290
|
|
|
|
|
|
|
# type => 'StringDetect' |
291
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, '#if 0', 0, 0, 0, undef, 0, 'Undeffed', 'Comment')) { |
292
|
0
|
|
|
|
|
|
return 1 |
293
|
|
|
|
|
|
|
} |
294
|
|
|
|
|
|
|
# attribute => 'Preprocessor' |
295
|
|
|
|
|
|
|
# char => '#' |
296
|
|
|
|
|
|
|
# column => '0' |
297
|
|
|
|
|
|
|
# context => 'Preprocessor' |
298
|
|
|
|
|
|
|
# type => 'DetectChar' |
299
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '#', 0, 0, 0, 0, 0, 'Preprocessor', 'Preprocessor')) { |
300
|
0
|
|
|
|
|
|
return 1 |
301
|
|
|
|
|
|
|
} |
302
|
0
|
|
|
|
|
|
return 0; |
303
|
|
|
|
|
|
|
}; |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
sub parseMultilineComment { |
306
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
307
|
|
|
|
|
|
|
# attribute => 'Comment' |
308
|
|
|
|
|
|
|
# char => '*' |
309
|
|
|
|
|
|
|
# char1 => '/' |
310
|
|
|
|
|
|
|
# context => '#pop' |
311
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
312
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { |
313
|
0
|
|
|
|
|
|
return 1 |
314
|
|
|
|
|
|
|
} |
315
|
|
|
|
|
|
|
# String => '(FIXME|TODO)' |
316
|
|
|
|
|
|
|
# attribute => 'Alert' |
317
|
|
|
|
|
|
|
# context => '#stay' |
318
|
|
|
|
|
|
|
# type => 'RegExpr' |
319
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) { |
320
|
0
|
|
|
|
|
|
return 1 |
321
|
|
|
|
|
|
|
} |
322
|
0
|
|
|
|
|
|
return 0; |
323
|
|
|
|
|
|
|
}; |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
sub parseMultilineComment2 { |
326
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
327
|
|
|
|
|
|
|
# attribute => 'Comment' |
328
|
|
|
|
|
|
|
# char => '*' |
329
|
|
|
|
|
|
|
# char1 => '/' |
330
|
|
|
|
|
|
|
# context => '#pop' |
331
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
332
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { |
333
|
0
|
|
|
|
|
|
return 1 |
334
|
|
|
|
|
|
|
} |
335
|
0
|
|
|
|
|
|
return 0; |
336
|
|
|
|
|
|
|
}; |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
sub parsePreprocessor { |
339
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
340
|
|
|
|
|
|
|
# attribute => 'Preprocessor' |
341
|
|
|
|
|
|
|
# context => '#stay' |
342
|
|
|
|
|
|
|
# type => 'LineContinue' |
343
|
0
|
0
|
|
|
|
|
if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) { |
344
|
0
|
|
|
|
|
|
return 1 |
345
|
|
|
|
|
|
|
} |
346
|
|
|
|
|
|
|
# attribute => 'Prep. Lib' |
347
|
|
|
|
|
|
|
# char => '"' |
348
|
|
|
|
|
|
|
# char1 => '"' |
349
|
|
|
|
|
|
|
# context => '#stay' |
350
|
|
|
|
|
|
|
# type => 'RangeDetect' |
351
|
0
|
0
|
|
|
|
|
if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Prep. Lib')) { |
352
|
0
|
|
|
|
|
|
return 1 |
353
|
|
|
|
|
|
|
} |
354
|
|
|
|
|
|
|
# attribute => 'Prep. Lib' |
355
|
|
|
|
|
|
|
# char => '<' |
356
|
|
|
|
|
|
|
# char1 => '>' |
357
|
|
|
|
|
|
|
# context => '#stay' |
358
|
|
|
|
|
|
|
# type => 'RangeDetect' |
359
|
0
|
0
|
|
|
|
|
if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Prep. Lib')) { |
360
|
0
|
|
|
|
|
|
return 1 |
361
|
|
|
|
|
|
|
} |
362
|
|
|
|
|
|
|
# attribute => 'Comment' |
363
|
|
|
|
|
|
|
# char => '/' |
364
|
|
|
|
|
|
|
# char1 => '/' |
365
|
|
|
|
|
|
|
# context => 'Comment' |
366
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
367
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { |
368
|
0
|
|
|
|
|
|
return 1 |
369
|
|
|
|
|
|
|
} |
370
|
|
|
|
|
|
|
# attribute => 'Comment' |
371
|
|
|
|
|
|
|
# char => '/' |
372
|
|
|
|
|
|
|
# char1 => '*' |
373
|
|
|
|
|
|
|
# context => 'Multiline Comment 2' |
374
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
375
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Multiline Comment 2', 'Comment')) { |
376
|
0
|
|
|
|
|
|
return 1 |
377
|
|
|
|
|
|
|
} |
378
|
0
|
|
|
|
|
|
return 0; |
379
|
|
|
|
|
|
|
}; |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
sub parseString { |
382
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
383
|
|
|
|
|
|
|
# attribute => 'String' |
384
|
|
|
|
|
|
|
# context => '#stay' |
385
|
|
|
|
|
|
|
# type => 'LineContinue' |
386
|
0
|
0
|
|
|
|
|
if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { |
387
|
0
|
|
|
|
|
|
return 1 |
388
|
|
|
|
|
|
|
} |
389
|
|
|
|
|
|
|
# attribute => 'String Char' |
390
|
|
|
|
|
|
|
# context => '#stay' |
391
|
|
|
|
|
|
|
# type => 'HlCStringChar' |
392
|
0
|
0
|
|
|
|
|
if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { |
393
|
0
|
|
|
|
|
|
return 1 |
394
|
|
|
|
|
|
|
} |
395
|
|
|
|
|
|
|
# attribute => 'String' |
396
|
|
|
|
|
|
|
# char => '"' |
397
|
|
|
|
|
|
|
# context => '#pop' |
398
|
|
|
|
|
|
|
# type => 'DetectChar' |
399
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { |
400
|
0
|
|
|
|
|
|
return 1 |
401
|
|
|
|
|
|
|
} |
402
|
0
|
|
|
|
|
|
return 0; |
403
|
|
|
|
|
|
|
}; |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
sub parseUndeffed { |
406
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
407
|
|
|
|
|
|
|
# String => '(FIXME|TODO)' |
408
|
|
|
|
|
|
|
# attribute => 'Alert' |
409
|
|
|
|
|
|
|
# context => '#stay' |
410
|
|
|
|
|
|
|
# type => 'RegExpr' |
411
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) { |
412
|
0
|
|
|
|
|
|
return 1 |
413
|
|
|
|
|
|
|
} |
414
|
|
|
|
|
|
|
# String => '#endif' |
415
|
|
|
|
|
|
|
# attribute => 'Comment' |
416
|
|
|
|
|
|
|
# column => '0' |
417
|
|
|
|
|
|
|
# context => '#pop' |
418
|
|
|
|
|
|
|
# type => 'StringDetect' |
419
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, '#endif', 0, 0, 0, 0, 0, '#pop', 'Comment')) { |
420
|
0
|
|
|
|
|
|
return 1 |
421
|
|
|
|
|
|
|
} |
422
|
0
|
|
|
|
|
|
return 0; |
423
|
|
|
|
|
|
|
}; |
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
sub parseunknown { |
426
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
427
|
0
|
|
|
|
|
|
return 0; |
428
|
|
|
|
|
|
|
}; |
429
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
sub parseunknown2 { |
431
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
432
|
0
|
|
|
|
|
|
return 0; |
433
|
|
|
|
|
|
|
}; |
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
1; |
437
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
__END__ |