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 'c.xml' file of the syntax highlight |
6
|
|
|
|
|
|
|
# engine of the kate text editor (http://www.kate-editor.org |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#kate xml version 1.25 |
9
|
|
|
|
|
|
|
#kate version 2.4 |
10
|
|
|
|
|
|
|
#generated: Sun Feb 3 22:02:04 2008, localtime |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Syntax::Highlight::Engine::Kate::C; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.07'; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
1271
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
17
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
18
|
1
|
|
|
1
|
|
6
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
15394
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
1
|
|
|
1
|
0
|
963
|
my $proto = shift; |
22
|
1
|
|
33
|
|
|
10
|
my $class = ref($proto) || $proto; |
23
|
1
|
|
|
|
|
14
|
my $self = $class->SUPER::new(@_); |
24
|
1
|
|
|
|
|
27
|
$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
|
|
|
|
|
|
|
'Region Marker' => 'RegionMarker', |
38
|
|
|
|
|
|
|
'String' => 'String', |
39
|
|
|
|
|
|
|
'String Char' => 'Char', |
40
|
|
|
|
|
|
|
'Symbol' => 'Normal', |
41
|
|
|
|
|
|
|
}); |
42
|
1
|
|
|
|
|
55
|
$self->listAdd('keywords', |
43
|
|
|
|
|
|
|
'break', |
44
|
|
|
|
|
|
|
'case', |
45
|
|
|
|
|
|
|
'continue', |
46
|
|
|
|
|
|
|
'default', |
47
|
|
|
|
|
|
|
'do', |
48
|
|
|
|
|
|
|
'else', |
49
|
|
|
|
|
|
|
'enum', |
50
|
|
|
|
|
|
|
'extern', |
51
|
|
|
|
|
|
|
'for', |
52
|
|
|
|
|
|
|
'goto', |
53
|
|
|
|
|
|
|
'if', |
54
|
|
|
|
|
|
|
'inline', |
55
|
|
|
|
|
|
|
'return', |
56
|
|
|
|
|
|
|
'sizeof', |
57
|
|
|
|
|
|
|
'struct', |
58
|
|
|
|
|
|
|
'switch', |
59
|
|
|
|
|
|
|
'typedef', |
60
|
|
|
|
|
|
|
'union', |
61
|
|
|
|
|
|
|
'while', |
62
|
|
|
|
|
|
|
); |
63
|
1
|
|
|
|
|
6
|
$self->listAdd('types', |
64
|
|
|
|
|
|
|
'_Bool', |
65
|
|
|
|
|
|
|
'_Complex', |
66
|
|
|
|
|
|
|
'_Imaginary', |
67
|
|
|
|
|
|
|
'auto', |
68
|
|
|
|
|
|
|
'char', |
69
|
|
|
|
|
|
|
'const', |
70
|
|
|
|
|
|
|
'double', |
71
|
|
|
|
|
|
|
'float', |
72
|
|
|
|
|
|
|
'int', |
73
|
|
|
|
|
|
|
'long', |
74
|
|
|
|
|
|
|
'register', |
75
|
|
|
|
|
|
|
'restrict', |
76
|
|
|
|
|
|
|
'short', |
77
|
|
|
|
|
|
|
'signed', |
78
|
|
|
|
|
|
|
'static', |
79
|
|
|
|
|
|
|
'unsigned', |
80
|
|
|
|
|
|
|
'void', |
81
|
|
|
|
|
|
|
'volatile', |
82
|
|
|
|
|
|
|
); |
83
|
1
|
|
|
|
|
41
|
$self->contextdata({ |
84
|
|
|
|
|
|
|
'Commentar 1' => { |
85
|
|
|
|
|
|
|
callback => \&parseCommentar1, |
86
|
|
|
|
|
|
|
attribute => 'Comment', |
87
|
|
|
|
|
|
|
lineending => '#pop', |
88
|
|
|
|
|
|
|
}, |
89
|
|
|
|
|
|
|
'Commentar 2' => { |
90
|
|
|
|
|
|
|
callback => \&parseCommentar2, |
91
|
|
|
|
|
|
|
attribute => 'Comment', |
92
|
|
|
|
|
|
|
}, |
93
|
|
|
|
|
|
|
'Commentar/Preprocessor' => { |
94
|
|
|
|
|
|
|
callback => \&parseCommentarPreprocessor, |
95
|
|
|
|
|
|
|
attribute => 'Comment', |
96
|
|
|
|
|
|
|
}, |
97
|
|
|
|
|
|
|
'Define' => { |
98
|
|
|
|
|
|
|
callback => \&parseDefine, |
99
|
|
|
|
|
|
|
attribute => 'Preprocessor', |
100
|
|
|
|
|
|
|
lineending => '#pop', |
101
|
|
|
|
|
|
|
}, |
102
|
|
|
|
|
|
|
'Normal' => { |
103
|
|
|
|
|
|
|
callback => \&parseNormal, |
104
|
|
|
|
|
|
|
attribute => 'Normal Text', |
105
|
|
|
|
|
|
|
}, |
106
|
|
|
|
|
|
|
'Outscoped' => { |
107
|
|
|
|
|
|
|
callback => \&parseOutscoped, |
108
|
|
|
|
|
|
|
attribute => 'Comment', |
109
|
|
|
|
|
|
|
}, |
110
|
|
|
|
|
|
|
'Outscoped intern' => { |
111
|
|
|
|
|
|
|
callback => \&parseOutscopedintern, |
112
|
|
|
|
|
|
|
attribute => 'Comment', |
113
|
|
|
|
|
|
|
}, |
114
|
|
|
|
|
|
|
'Preprocessor' => { |
115
|
|
|
|
|
|
|
callback => \&parsePreprocessor, |
116
|
|
|
|
|
|
|
attribute => 'Preprocessor', |
117
|
|
|
|
|
|
|
lineending => '#pop', |
118
|
|
|
|
|
|
|
}, |
119
|
|
|
|
|
|
|
'Region Marker' => { |
120
|
|
|
|
|
|
|
callback => \&parseRegionMarker, |
121
|
|
|
|
|
|
|
attribute => 'Region Marker', |
122
|
|
|
|
|
|
|
lineending => '#pop', |
123
|
|
|
|
|
|
|
}, |
124
|
|
|
|
|
|
|
'String' => { |
125
|
|
|
|
|
|
|
callback => \&parseString, |
126
|
|
|
|
|
|
|
attribute => 'String', |
127
|
|
|
|
|
|
|
lineending => '#pop', |
128
|
|
|
|
|
|
|
}, |
129
|
|
|
|
|
|
|
}); |
130
|
1
|
|
|
|
|
94
|
$self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
131
|
1
|
|
|
|
|
5
|
$self->basecontext('Normal'); |
132
|
1
|
|
|
|
|
10
|
$self->keywordscase(0); |
133
|
1
|
|
|
|
|
4
|
$self->initialize; |
134
|
1
|
|
|
|
|
4
|
bless ($self, $class); |
135
|
1
|
|
|
|
|
5
|
return $self; |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub language { |
139
|
0
|
|
|
0
|
0
|
|
return 'C'; |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
sub parseCommentar1 { |
143
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
144
|
|
|
|
|
|
|
# context => '##Alerts' |
145
|
|
|
|
|
|
|
# type => 'IncludeRules' |
146
|
0
|
0
|
|
|
|
|
if ($self->includePlugin('Alerts', $text)) { |
147
|
0
|
|
|
|
|
|
return 1 |
148
|
|
|
|
|
|
|
} |
149
|
0
|
|
|
|
|
|
return 0; |
150
|
|
|
|
|
|
|
}; |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
sub parseCommentar2 { |
153
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
154
|
|
|
|
|
|
|
# attribute => 'Comment' |
155
|
|
|
|
|
|
|
# char => '*' |
156
|
|
|
|
|
|
|
# char1 => '/' |
157
|
|
|
|
|
|
|
# context => '#pop' |
158
|
|
|
|
|
|
|
# endRegion => 'Comment' |
159
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
160
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { |
161
|
0
|
|
|
|
|
|
return 1 |
162
|
|
|
|
|
|
|
} |
163
|
|
|
|
|
|
|
# context => '##Alerts' |
164
|
|
|
|
|
|
|
# type => 'IncludeRules' |
165
|
0
|
0
|
|
|
|
|
if ($self->includePlugin('Alerts', $text)) { |
166
|
0
|
|
|
|
|
|
return 1 |
167
|
|
|
|
|
|
|
} |
168
|
0
|
|
|
|
|
|
return 0; |
169
|
|
|
|
|
|
|
}; |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
sub parseCommentarPreprocessor { |
172
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
173
|
|
|
|
|
|
|
# attribute => 'Comment' |
174
|
|
|
|
|
|
|
# char => '*' |
175
|
|
|
|
|
|
|
# char1 => '/' |
176
|
|
|
|
|
|
|
# context => '#pop' |
177
|
|
|
|
|
|
|
# endRegion => 'Comment2' |
178
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
179
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { |
180
|
0
|
|
|
|
|
|
return 1 |
181
|
|
|
|
|
|
|
} |
182
|
0
|
|
|
|
|
|
return 0; |
183
|
|
|
|
|
|
|
}; |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
sub parseDefine { |
186
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
187
|
|
|
|
|
|
|
# attribute => 'Preprocessor' |
188
|
|
|
|
|
|
|
# context => '#stay' |
189
|
|
|
|
|
|
|
# type => 'LineContinue' |
190
|
0
|
0
|
|
|
|
|
if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) { |
191
|
0
|
|
|
|
|
|
return 1 |
192
|
|
|
|
|
|
|
} |
193
|
0
|
|
|
|
|
|
return 0; |
194
|
|
|
|
|
|
|
}; |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
sub parseNormal { |
197
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
198
|
|
|
|
|
|
|
# type => 'DetectSpaces' |
199
|
0
|
0
|
|
|
|
|
if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { |
200
|
0
|
|
|
|
|
|
return 1 |
201
|
|
|
|
|
|
|
} |
202
|
|
|
|
|
|
|
# String => '#\s*if\s+0' |
203
|
|
|
|
|
|
|
# attribute => 'Preprocessor' |
204
|
|
|
|
|
|
|
# beginRegion => 'Outscoped' |
205
|
|
|
|
|
|
|
# context => 'Outscoped' |
206
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
207
|
|
|
|
|
|
|
# type => 'RegExpr' |
208
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '#\\s*if\\s+0', 0, 0, 0, undef, 1, 'Outscoped', 'Preprocessor')) { |
209
|
0
|
|
|
|
|
|
return 1 |
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
# attribute => 'Preprocessor' |
212
|
|
|
|
|
|
|
# char => '#' |
213
|
|
|
|
|
|
|
# context => 'Preprocessor' |
214
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
215
|
|
|
|
|
|
|
# type => 'DetectChar' |
216
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Preprocessor', 'Preprocessor')) { |
217
|
0
|
|
|
|
|
|
return 1 |
218
|
|
|
|
|
|
|
} |
219
|
|
|
|
|
|
|
# String => '//BEGIN' |
220
|
|
|
|
|
|
|
# attribute => 'Region Marker' |
221
|
|
|
|
|
|
|
# beginRegion => 'Region1' |
222
|
|
|
|
|
|
|
# context => 'Region Marker' |
223
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
224
|
|
|
|
|
|
|
# type => 'StringDetect' |
225
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, '//BEGIN', 0, 0, 0, undef, 1, 'Region Marker', 'Region Marker')) { |
226
|
0
|
|
|
|
|
|
return 1 |
227
|
|
|
|
|
|
|
} |
228
|
|
|
|
|
|
|
# String => '//END' |
229
|
|
|
|
|
|
|
# attribute => 'Region Marker' |
230
|
|
|
|
|
|
|
# context => 'Region Marker' |
231
|
|
|
|
|
|
|
# endRegion => 'Region1' |
232
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
233
|
|
|
|
|
|
|
# type => 'StringDetect' |
234
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, '//END', 0, 0, 0, undef, 1, 'Region Marker', 'Region Marker')) { |
235
|
0
|
|
|
|
|
|
return 1 |
236
|
|
|
|
|
|
|
} |
237
|
|
|
|
|
|
|
# String => 'keywords' |
238
|
|
|
|
|
|
|
# attribute => 'Keyword' |
239
|
|
|
|
|
|
|
# context => '#stay' |
240
|
|
|
|
|
|
|
# type => 'keyword' |
241
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { |
242
|
0
|
|
|
|
|
|
return 1 |
243
|
|
|
|
|
|
|
} |
244
|
|
|
|
|
|
|
# String => 'types' |
245
|
|
|
|
|
|
|
# attribute => 'Data Type' |
246
|
|
|
|
|
|
|
# context => '#stay' |
247
|
|
|
|
|
|
|
# type => 'keyword' |
248
|
0
|
0
|
|
|
|
|
if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { |
249
|
0
|
|
|
|
|
|
return 1 |
250
|
|
|
|
|
|
|
} |
251
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
252
|
0
|
0
|
|
|
|
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
253
|
0
|
|
|
|
|
|
return 1 |
254
|
|
|
|
|
|
|
} |
255
|
|
|
|
|
|
|
# attribute => 'Symbol' |
256
|
|
|
|
|
|
|
# beginRegion => 'Brace1' |
257
|
|
|
|
|
|
|
# char => '{' |
258
|
|
|
|
|
|
|
# context => '#stay' |
259
|
|
|
|
|
|
|
# type => 'DetectChar' |
260
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { |
261
|
0
|
|
|
|
|
|
return 1 |
262
|
|
|
|
|
|
|
} |
263
|
|
|
|
|
|
|
# attribute => 'Symbol' |
264
|
|
|
|
|
|
|
# char => '}' |
265
|
|
|
|
|
|
|
# context => '#stay' |
266
|
|
|
|
|
|
|
# endRegion => 'Brace1' |
267
|
|
|
|
|
|
|
# type => 'DetectChar' |
268
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { |
269
|
0
|
|
|
|
|
|
return 1 |
270
|
|
|
|
|
|
|
} |
271
|
|
|
|
|
|
|
# attribute => 'Float' |
272
|
|
|
|
|
|
|
# context => '#stay' |
273
|
|
|
|
|
|
|
# items => 'ARRAY(0x12df8b0)' |
274
|
|
|
|
|
|
|
# type => 'Float' |
275
|
0
|
0
|
|
|
|
|
if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { |
276
|
|
|
|
|
|
|
# String => 'fF' |
277
|
|
|
|
|
|
|
# attribute => 'Float' |
278
|
|
|
|
|
|
|
# context => '#stay' |
279
|
|
|
|
|
|
|
# type => 'AnyChar' |
280
|
0
|
0
|
|
|
|
|
if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) { |
281
|
0
|
|
|
|
|
|
return 1 |
282
|
|
|
|
|
|
|
} |
283
|
|
|
|
|
|
|
} |
284
|
|
|
|
|
|
|
# attribute => 'Octal' |
285
|
|
|
|
|
|
|
# context => '#stay' |
286
|
|
|
|
|
|
|
# type => 'HlCOct' |
287
|
0
|
0
|
|
|
|
|
if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { |
288
|
0
|
|
|
|
|
|
return 1 |
289
|
|
|
|
|
|
|
} |
290
|
|
|
|
|
|
|
# attribute => 'Hex' |
291
|
|
|
|
|
|
|
# context => '#stay' |
292
|
|
|
|
|
|
|
# type => 'HlCHex' |
293
|
0
|
0
|
|
|
|
|
if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { |
294
|
0
|
|
|
|
|
|
return 1 |
295
|
|
|
|
|
|
|
} |
296
|
|
|
|
|
|
|
# attribute => 'Decimal' |
297
|
|
|
|
|
|
|
# context => '#stay' |
298
|
|
|
|
|
|
|
# items => 'ARRAY(0x12207d0)' |
299
|
|
|
|
|
|
|
# type => 'Int' |
300
|
0
|
0
|
|
|
|
|
if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { |
301
|
|
|
|
|
|
|
# String => 'ULL' |
302
|
|
|
|
|
|
|
# attribute => 'Decimal' |
303
|
|
|
|
|
|
|
# context => '#stay' |
304
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
305
|
|
|
|
|
|
|
# type => 'StringDetect' |
306
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { |
307
|
0
|
|
|
|
|
|
return 1 |
308
|
|
|
|
|
|
|
} |
309
|
|
|
|
|
|
|
# String => 'LUL' |
310
|
|
|
|
|
|
|
# attribute => 'Decimal' |
311
|
|
|
|
|
|
|
# context => '#stay' |
312
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
313
|
|
|
|
|
|
|
# type => 'StringDetect' |
314
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { |
315
|
0
|
|
|
|
|
|
return 1 |
316
|
|
|
|
|
|
|
} |
317
|
|
|
|
|
|
|
# String => 'LLU' |
318
|
|
|
|
|
|
|
# attribute => 'Decimal' |
319
|
|
|
|
|
|
|
# context => '#stay' |
320
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
321
|
|
|
|
|
|
|
# type => 'StringDetect' |
322
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { |
323
|
0
|
|
|
|
|
|
return 1 |
324
|
|
|
|
|
|
|
} |
325
|
|
|
|
|
|
|
# String => 'UL' |
326
|
|
|
|
|
|
|
# attribute => 'Decimal' |
327
|
|
|
|
|
|
|
# context => '#stay' |
328
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
329
|
|
|
|
|
|
|
# type => 'StringDetect' |
330
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { |
331
|
0
|
|
|
|
|
|
return 1 |
332
|
|
|
|
|
|
|
} |
333
|
|
|
|
|
|
|
# String => 'LU' |
334
|
|
|
|
|
|
|
# attribute => 'Decimal' |
335
|
|
|
|
|
|
|
# context => '#stay' |
336
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
337
|
|
|
|
|
|
|
# type => 'StringDetect' |
338
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { |
339
|
0
|
|
|
|
|
|
return 1 |
340
|
|
|
|
|
|
|
} |
341
|
|
|
|
|
|
|
# String => 'LL' |
342
|
|
|
|
|
|
|
# attribute => 'Decimal' |
343
|
|
|
|
|
|
|
# context => '#stay' |
344
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
345
|
|
|
|
|
|
|
# type => 'StringDetect' |
346
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { |
347
|
0
|
|
|
|
|
|
return 1 |
348
|
|
|
|
|
|
|
} |
349
|
|
|
|
|
|
|
# String => 'U' |
350
|
|
|
|
|
|
|
# attribute => 'Decimal' |
351
|
|
|
|
|
|
|
# context => '#stay' |
352
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
353
|
|
|
|
|
|
|
# type => 'StringDetect' |
354
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { |
355
|
0
|
|
|
|
|
|
return 1 |
356
|
|
|
|
|
|
|
} |
357
|
|
|
|
|
|
|
# String => 'L' |
358
|
|
|
|
|
|
|
# attribute => 'Decimal' |
359
|
|
|
|
|
|
|
# context => '#stay' |
360
|
|
|
|
|
|
|
# insensitive => 'TRUE' |
361
|
|
|
|
|
|
|
# type => 'StringDetect' |
362
|
0
|
0
|
|
|
|
|
if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { |
363
|
0
|
|
|
|
|
|
return 1 |
364
|
|
|
|
|
|
|
} |
365
|
|
|
|
|
|
|
} |
366
|
|
|
|
|
|
|
# attribute => 'Char' |
367
|
|
|
|
|
|
|
# context => '#stay' |
368
|
|
|
|
|
|
|
# type => 'HlCChar' |
369
|
0
|
0
|
|
|
|
|
if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { |
370
|
0
|
|
|
|
|
|
return 1 |
371
|
|
|
|
|
|
|
} |
372
|
|
|
|
|
|
|
# attribute => 'String' |
373
|
|
|
|
|
|
|
# char => '"' |
374
|
|
|
|
|
|
|
# context => 'String' |
375
|
|
|
|
|
|
|
# type => 'DetectChar' |
376
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { |
377
|
0
|
|
|
|
|
|
return 1 |
378
|
|
|
|
|
|
|
} |
379
|
|
|
|
|
|
|
# context => '##Doxygen' |
380
|
|
|
|
|
|
|
# type => 'IncludeRules' |
381
|
0
|
0
|
|
|
|
|
if ($self->includePlugin('Doxygen', $text)) { |
382
|
0
|
|
|
|
|
|
return 1 |
383
|
|
|
|
|
|
|
} |
384
|
|
|
|
|
|
|
# attribute => 'Comment' |
385
|
|
|
|
|
|
|
# char => '/' |
386
|
|
|
|
|
|
|
# char1 => '/' |
387
|
|
|
|
|
|
|
# context => 'Commentar 1' |
388
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
389
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { |
390
|
0
|
|
|
|
|
|
return 1 |
391
|
|
|
|
|
|
|
} |
392
|
|
|
|
|
|
|
# attribute => 'Comment' |
393
|
|
|
|
|
|
|
# beginRegion => 'Comment' |
394
|
|
|
|
|
|
|
# char => '/' |
395
|
|
|
|
|
|
|
# char1 => '*' |
396
|
|
|
|
|
|
|
# context => 'Commentar 2' |
397
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
398
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { |
399
|
0
|
|
|
|
|
|
return 1 |
400
|
|
|
|
|
|
|
} |
401
|
|
|
|
|
|
|
# String => ':!%&()+,-/.*<=>?[]|~^;' |
402
|
|
|
|
|
|
|
# attribute => 'Symbol' |
403
|
|
|
|
|
|
|
# context => '#stay' |
404
|
|
|
|
|
|
|
# type => 'AnyChar' |
405
|
0
|
0
|
|
|
|
|
if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]|~^;', 0, 0, undef, 0, '#stay', 'Symbol')) { |
406
|
0
|
|
|
|
|
|
return 1 |
407
|
|
|
|
|
|
|
} |
408
|
0
|
|
|
|
|
|
return 0; |
409
|
|
|
|
|
|
|
}; |
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
sub parseOutscoped { |
412
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
413
|
|
|
|
|
|
|
# type => 'DetectSpaces' |
414
|
0
|
0
|
|
|
|
|
if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { |
415
|
0
|
|
|
|
|
|
return 1 |
416
|
|
|
|
|
|
|
} |
417
|
|
|
|
|
|
|
# context => '##Alerts' |
418
|
|
|
|
|
|
|
# type => 'IncludeRules' |
419
|
0
|
0
|
|
|
|
|
if ($self->includePlugin('Alerts', $text)) { |
420
|
0
|
|
|
|
|
|
return 1 |
421
|
|
|
|
|
|
|
} |
422
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
423
|
0
|
0
|
|
|
|
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
424
|
0
|
|
|
|
|
|
return 1 |
425
|
|
|
|
|
|
|
} |
426
|
|
|
|
|
|
|
# attribute => 'String' |
427
|
|
|
|
|
|
|
# char => '"' |
428
|
|
|
|
|
|
|
# context => 'String' |
429
|
|
|
|
|
|
|
# type => 'DetectChar' |
430
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { |
431
|
0
|
|
|
|
|
|
return 1 |
432
|
|
|
|
|
|
|
} |
433
|
|
|
|
|
|
|
# context => '##Doxygen' |
434
|
|
|
|
|
|
|
# type => 'IncludeRules' |
435
|
0
|
0
|
|
|
|
|
if ($self->includePlugin('Doxygen', $text)) { |
436
|
0
|
|
|
|
|
|
return 1 |
437
|
|
|
|
|
|
|
} |
438
|
|
|
|
|
|
|
# attribute => 'Comment' |
439
|
|
|
|
|
|
|
# char => '/' |
440
|
|
|
|
|
|
|
# char1 => '/' |
441
|
|
|
|
|
|
|
# context => 'Commentar 1' |
442
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
443
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { |
444
|
0
|
|
|
|
|
|
return 1 |
445
|
|
|
|
|
|
|
} |
446
|
|
|
|
|
|
|
# attribute => 'Comment' |
447
|
|
|
|
|
|
|
# beginRegion => 'Comment' |
448
|
|
|
|
|
|
|
# char => '/' |
449
|
|
|
|
|
|
|
# char1 => '*' |
450
|
|
|
|
|
|
|
# context => 'Commentar 2' |
451
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
452
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { |
453
|
0
|
|
|
|
|
|
return 1 |
454
|
|
|
|
|
|
|
} |
455
|
|
|
|
|
|
|
# String => '#\s*if' |
456
|
|
|
|
|
|
|
# attribute => 'Comment' |
457
|
|
|
|
|
|
|
# beginRegion => 'Outscoped' |
458
|
|
|
|
|
|
|
# context => 'Outscoped intern' |
459
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
460
|
|
|
|
|
|
|
# type => 'RegExpr' |
461
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) { |
462
|
0
|
|
|
|
|
|
return 1 |
463
|
|
|
|
|
|
|
} |
464
|
|
|
|
|
|
|
# String => '#\s*(endif|else|elif)' |
465
|
|
|
|
|
|
|
# attribute => 'Preprocessor' |
466
|
|
|
|
|
|
|
# context => '#pop' |
467
|
|
|
|
|
|
|
# endRegion => 'Outscoped' |
468
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
469
|
|
|
|
|
|
|
# type => 'RegExpr' |
470
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '#\\s*(endif|else|elif)', 0, 0, 0, undef, 1, '#pop', 'Preprocessor')) { |
471
|
0
|
|
|
|
|
|
return 1 |
472
|
|
|
|
|
|
|
} |
473
|
0
|
|
|
|
|
|
return 0; |
474
|
|
|
|
|
|
|
}; |
475
|
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
sub parseOutscopedintern { |
477
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
478
|
|
|
|
|
|
|
# type => 'DetectSpaces' |
479
|
0
|
0
|
|
|
|
|
if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { |
480
|
0
|
|
|
|
|
|
return 1 |
481
|
|
|
|
|
|
|
} |
482
|
|
|
|
|
|
|
# context => '##Alerts' |
483
|
|
|
|
|
|
|
# type => 'IncludeRules' |
484
|
0
|
0
|
|
|
|
|
if ($self->includePlugin('Alerts', $text)) { |
485
|
0
|
|
|
|
|
|
return 1 |
486
|
|
|
|
|
|
|
} |
487
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
488
|
0
|
0
|
|
|
|
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
489
|
0
|
|
|
|
|
|
return 1 |
490
|
|
|
|
|
|
|
} |
491
|
|
|
|
|
|
|
# attribute => 'String' |
492
|
|
|
|
|
|
|
# char => '"' |
493
|
|
|
|
|
|
|
# context => 'String' |
494
|
|
|
|
|
|
|
# type => 'DetectChar' |
495
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { |
496
|
0
|
|
|
|
|
|
return 1 |
497
|
|
|
|
|
|
|
} |
498
|
|
|
|
|
|
|
# context => '##Doxygen' |
499
|
|
|
|
|
|
|
# type => 'IncludeRules' |
500
|
0
|
0
|
|
|
|
|
if ($self->includePlugin('Doxygen', $text)) { |
501
|
0
|
|
|
|
|
|
return 1 |
502
|
|
|
|
|
|
|
} |
503
|
|
|
|
|
|
|
# attribute => 'Comment' |
504
|
|
|
|
|
|
|
# char => '/' |
505
|
|
|
|
|
|
|
# char1 => '/' |
506
|
|
|
|
|
|
|
# context => 'Commentar 1' |
507
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
508
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { |
509
|
0
|
|
|
|
|
|
return 1 |
510
|
|
|
|
|
|
|
} |
511
|
|
|
|
|
|
|
# attribute => 'Comment' |
512
|
|
|
|
|
|
|
# beginRegion => 'Comment' |
513
|
|
|
|
|
|
|
# char => '/' |
514
|
|
|
|
|
|
|
# char1 => '*' |
515
|
|
|
|
|
|
|
# context => 'Commentar 2' |
516
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
517
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) { |
518
|
0
|
|
|
|
|
|
return 1 |
519
|
|
|
|
|
|
|
} |
520
|
|
|
|
|
|
|
# String => '#\s*if' |
521
|
|
|
|
|
|
|
# attribute => 'Comment' |
522
|
|
|
|
|
|
|
# beginRegion => 'Outscoped' |
523
|
|
|
|
|
|
|
# context => 'Outscoped intern' |
524
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
525
|
|
|
|
|
|
|
# type => 'RegExpr' |
526
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) { |
527
|
0
|
|
|
|
|
|
return 1 |
528
|
|
|
|
|
|
|
} |
529
|
|
|
|
|
|
|
# String => '#\s*endif' |
530
|
|
|
|
|
|
|
# attribute => 'Comment' |
531
|
|
|
|
|
|
|
# context => '#pop' |
532
|
|
|
|
|
|
|
# endRegion => 'Outscoped' |
533
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
534
|
|
|
|
|
|
|
# type => 'RegExpr' |
535
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, '#\\s*endif', 0, 0, 0, undef, 1, '#pop', 'Comment')) { |
536
|
0
|
|
|
|
|
|
return 1 |
537
|
|
|
|
|
|
|
} |
538
|
0
|
|
|
|
|
|
return 0; |
539
|
|
|
|
|
|
|
}; |
540
|
|
|
|
|
|
|
|
541
|
|
|
|
|
|
|
sub parsePreprocessor { |
542
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
543
|
|
|
|
|
|
|
# attribute => 'Preprocessor' |
544
|
|
|
|
|
|
|
# context => '#stay' |
545
|
|
|
|
|
|
|
# type => 'LineContinue' |
546
|
0
|
0
|
|
|
|
|
if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) { |
547
|
0
|
|
|
|
|
|
return 1 |
548
|
|
|
|
|
|
|
} |
549
|
|
|
|
|
|
|
# String => 'define.*((?=\\))' |
550
|
|
|
|
|
|
|
# attribute => 'Preprocessor' |
551
|
|
|
|
|
|
|
# context => 'Define' |
552
|
|
|
|
|
|
|
# type => 'RegExpr' |
553
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, 'define.*((?=\\\\))', 0, 0, 0, undef, 0, 'Define', 'Preprocessor')) { |
554
|
0
|
|
|
|
|
|
return 1 |
555
|
|
|
|
|
|
|
} |
556
|
|
|
|
|
|
|
# String => 'define.*' |
557
|
|
|
|
|
|
|
# attribute => 'Preprocessor' |
558
|
|
|
|
|
|
|
# context => '#stay' |
559
|
|
|
|
|
|
|
# type => 'RegExpr' |
560
|
0
|
0
|
|
|
|
|
if ($self->testRegExpr($text, 'define.*', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) { |
561
|
0
|
|
|
|
|
|
return 1 |
562
|
|
|
|
|
|
|
} |
563
|
|
|
|
|
|
|
# attribute => 'Prep. Lib' |
564
|
|
|
|
|
|
|
# char => '"' |
565
|
|
|
|
|
|
|
# char1 => '"' |
566
|
|
|
|
|
|
|
# context => '#stay' |
567
|
|
|
|
|
|
|
# type => 'RangeDetect' |
568
|
0
|
0
|
|
|
|
|
if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Prep. Lib')) { |
569
|
0
|
|
|
|
|
|
return 1 |
570
|
|
|
|
|
|
|
} |
571
|
|
|
|
|
|
|
# attribute => 'Prep. Lib' |
572
|
|
|
|
|
|
|
# char => '<' |
573
|
|
|
|
|
|
|
# char1 => '>' |
574
|
|
|
|
|
|
|
# context => '#stay' |
575
|
|
|
|
|
|
|
# type => 'RangeDetect' |
576
|
0
|
0
|
|
|
|
|
if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Prep. Lib')) { |
577
|
0
|
|
|
|
|
|
return 1 |
578
|
|
|
|
|
|
|
} |
579
|
|
|
|
|
|
|
# context => '##Doxygen' |
580
|
|
|
|
|
|
|
# type => 'IncludeRules' |
581
|
0
|
0
|
|
|
|
|
if ($self->includePlugin('Doxygen', $text)) { |
582
|
0
|
|
|
|
|
|
return 1 |
583
|
|
|
|
|
|
|
} |
584
|
|
|
|
|
|
|
# attribute => 'Comment' |
585
|
|
|
|
|
|
|
# beginRegion => 'Comment2' |
586
|
|
|
|
|
|
|
# char => '/' |
587
|
|
|
|
|
|
|
# char1 => '*' |
588
|
|
|
|
|
|
|
# context => 'Commentar/Preprocessor' |
589
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
590
|
0
|
0
|
|
|
|
|
if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar/Preprocessor', 'Comment')) { |
591
|
0
|
|
|
|
|
|
return 1 |
592
|
|
|
|
|
|
|
} |
593
|
0
|
|
|
|
|
|
return 0; |
594
|
|
|
|
|
|
|
}; |
595
|
|
|
|
|
|
|
|
596
|
|
|
|
|
|
|
sub parseRegionMarker { |
597
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
598
|
0
|
|
|
|
|
|
return 0; |
599
|
|
|
|
|
|
|
}; |
600
|
|
|
|
|
|
|
|
601
|
|
|
|
|
|
|
sub parseString { |
602
|
0
|
|
|
0
|
0
|
|
my ($self, $text) = @_; |
603
|
|
|
|
|
|
|
# attribute => 'String' |
604
|
|
|
|
|
|
|
# context => '#stay' |
605
|
|
|
|
|
|
|
# type => 'LineContinue' |
606
|
0
|
0
|
|
|
|
|
if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { |
607
|
0
|
|
|
|
|
|
return 1 |
608
|
|
|
|
|
|
|
} |
609
|
|
|
|
|
|
|
# attribute => 'String Char' |
610
|
|
|
|
|
|
|
# context => '#stay' |
611
|
|
|
|
|
|
|
# type => 'HlCStringChar' |
612
|
0
|
0
|
|
|
|
|
if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { |
613
|
0
|
|
|
|
|
|
return 1 |
614
|
|
|
|
|
|
|
} |
615
|
|
|
|
|
|
|
# attribute => 'String' |
616
|
|
|
|
|
|
|
# char => '"' |
617
|
|
|
|
|
|
|
# context => '#pop' |
618
|
|
|
|
|
|
|
# type => 'DetectChar' |
619
|
0
|
0
|
|
|
|
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { |
620
|
0
|
|
|
|
|
|
return 1 |
621
|
|
|
|
|
|
|
} |
622
|
0
|
|
|
|
|
|
return 0; |
623
|
|
|
|
|
|
|
}; |
624
|
|
|
|
|
|
|
|
625
|
|
|
|
|
|
|
|
626
|
|
|
|
|
|
|
1; |
627
|
|
|
|
|
|
|
|
628
|
|
|
|
|
|
|
__END__ |