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 'xslt.xml' file of the syntax highlight |
6
|
|
|
|
|
|
|
# engine of the kate text editor (http://www.kate-editor.org |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#kate xml version 1.03 |
9
|
|
|
|
|
|
|
#kate version 2.1 |
10
|
|
|
|
|
|
|
#kate author Peter Lammich (views@gmx.de) |
11
|
|
|
|
|
|
|
#generated: Sun Feb 3 22:02:06 2008, localtime |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
package Syntax::Highlight::Engine::Kate::Xslt; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = '0.07'; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
1076
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
37
|
|
18
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
39
|
|
19
|
1
|
|
|
1
|
|
6
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2563
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
2
|
|
|
2
|
0
|
967
|
my $proto = shift; |
23
|
2
|
|
33
|
|
|
14
|
my $class = ref($proto) || $proto; |
24
|
2
|
|
|
|
|
18
|
my $self = $class->SUPER::new(@_); |
25
|
2
|
|
|
|
|
44
|
$self->attributes({ |
26
|
|
|
|
|
|
|
'Alert' => 'Alert', |
27
|
|
|
|
|
|
|
'Attribute' => 'Others', |
28
|
|
|
|
|
|
|
'Attribute Value' => 'BaseN', |
29
|
|
|
|
|
|
|
'Comment' => 'Comment', |
30
|
|
|
|
|
|
|
'Entity Reference' => 'Char', |
31
|
|
|
|
|
|
|
'Invalid' => 'Error', |
32
|
|
|
|
|
|
|
'Normal Text' => 'Normal', |
33
|
|
|
|
|
|
|
'Tag' => 'Keyword', |
34
|
|
|
|
|
|
|
'Variable' => 'Variable', |
35
|
|
|
|
|
|
|
'XPath' => 'Others', |
36
|
|
|
|
|
|
|
'XPath 2.0/ XSLT 2.0 Function' => 'Operator', |
37
|
|
|
|
|
|
|
'XPath Attribute' => 'Float', |
38
|
|
|
|
|
|
|
'XPath Axis' => 'DecVal', |
39
|
|
|
|
|
|
|
'XPath String' => 'BaseN', |
40
|
|
|
|
|
|
|
'XPath/ XSLT Function' => 'Function', |
41
|
|
|
|
|
|
|
'XSLT 2.0 Tag' => 'Reserved', |
42
|
|
|
|
|
|
|
'XSLT Tag' => 'Reserved', |
43
|
|
|
|
|
|
|
}); |
44
|
2
|
|
|
|
|
24
|
$self->listAdd('functions', |
45
|
|
|
|
|
|
|
'boolean', |
46
|
|
|
|
|
|
|
'ceiling', |
47
|
|
|
|
|
|
|
'concat', |
48
|
|
|
|
|
|
|
'contains', |
49
|
|
|
|
|
|
|
'count', |
50
|
|
|
|
|
|
|
'current', |
51
|
|
|
|
|
|
|
'document', |
52
|
|
|
|
|
|
|
'element-available', |
53
|
|
|
|
|
|
|
'false', |
54
|
|
|
|
|
|
|
'floor', |
55
|
|
|
|
|
|
|
'format-number', |
56
|
|
|
|
|
|
|
'function-available', |
57
|
|
|
|
|
|
|
'generate-id', |
58
|
|
|
|
|
|
|
'id', |
59
|
|
|
|
|
|
|
'key', |
60
|
|
|
|
|
|
|
'lang', |
61
|
|
|
|
|
|
|
'last', |
62
|
|
|
|
|
|
|
'local-name', |
63
|
|
|
|
|
|
|
'name', |
64
|
|
|
|
|
|
|
'namespace-uri', |
65
|
|
|
|
|
|
|
'normalize-space', |
66
|
|
|
|
|
|
|
'not', |
67
|
|
|
|
|
|
|
'number', |
68
|
|
|
|
|
|
|
'position', |
69
|
|
|
|
|
|
|
'round', |
70
|
|
|
|
|
|
|
'starts-with', |
71
|
|
|
|
|
|
|
'string', |
72
|
|
|
|
|
|
|
'string-length', |
73
|
|
|
|
|
|
|
'substring', |
74
|
|
|
|
|
|
|
'substring-after', |
75
|
|
|
|
|
|
|
'substring-before', |
76
|
|
|
|
|
|
|
'sum', |
77
|
|
|
|
|
|
|
'system-property', |
78
|
|
|
|
|
|
|
'text', |
79
|
|
|
|
|
|
|
'translate', |
80
|
|
|
|
|
|
|
'true', |
81
|
|
|
|
|
|
|
'unparsed-entity-uri', |
82
|
|
|
|
|
|
|
); |
83
|
2
|
|
|
|
|
13
|
$self->listAdd('functions_2.0', |
84
|
|
|
|
|
|
|
'QName', |
85
|
|
|
|
|
|
|
'abs', |
86
|
|
|
|
|
|
|
'adjust-date-to-timezone', |
87
|
|
|
|
|
|
|
'adjust-dateTime-to-timezone', |
88
|
|
|
|
|
|
|
'adjust-time-to-timezone', |
89
|
|
|
|
|
|
|
'avg', |
90
|
|
|
|
|
|
|
'base-uri', |
91
|
|
|
|
|
|
|
'codepoints-to-string', |
92
|
|
|
|
|
|
|
'collection', |
93
|
|
|
|
|
|
|
'compare', |
94
|
|
|
|
|
|
|
'current-date', |
95
|
|
|
|
|
|
|
'current-dateTime', |
96
|
|
|
|
|
|
|
'current-group', |
97
|
|
|
|
|
|
|
'current-grouping-key', |
98
|
|
|
|
|
|
|
'current-time', |
99
|
|
|
|
|
|
|
'data', |
100
|
|
|
|
|
|
|
'dateTime', |
101
|
|
|
|
|
|
|
'day-from-date', |
102
|
|
|
|
|
|
|
'day-from-dateTime', |
103
|
|
|
|
|
|
|
'days-from-duration', |
104
|
|
|
|
|
|
|
'deep-equal', |
105
|
|
|
|
|
|
|
'default-collation', |
106
|
|
|
|
|
|
|
'distinct-values', |
107
|
|
|
|
|
|
|
'doc', |
108
|
|
|
|
|
|
|
'document-uri', |
109
|
|
|
|
|
|
|
'empty', |
110
|
|
|
|
|
|
|
'ends-with', |
111
|
|
|
|
|
|
|
'error', |
112
|
|
|
|
|
|
|
'escape-uri', |
113
|
|
|
|
|
|
|
'exactly-one', |
114
|
|
|
|
|
|
|
'exists', |
115
|
|
|
|
|
|
|
'expanded-QName', |
116
|
|
|
|
|
|
|
'format-date', |
117
|
|
|
|
|
|
|
'format-dateTime', |
118
|
|
|
|
|
|
|
'format-time', |
119
|
|
|
|
|
|
|
'hours-from-dateTime', |
120
|
|
|
|
|
|
|
'hours-from-duration', |
121
|
|
|
|
|
|
|
'hours-from-time', |
122
|
|
|
|
|
|
|
'idref', |
123
|
|
|
|
|
|
|
'implicit-timezone', |
124
|
|
|
|
|
|
|
'in-scope-prefixes', |
125
|
|
|
|
|
|
|
'index-of', |
126
|
|
|
|
|
|
|
'input', |
127
|
|
|
|
|
|
|
'insert-before', |
128
|
|
|
|
|
|
|
'local-name-from-QName', |
129
|
|
|
|
|
|
|
'lower-case', |
130
|
|
|
|
|
|
|
'matches', |
131
|
|
|
|
|
|
|
'max', |
132
|
|
|
|
|
|
|
'min', |
133
|
|
|
|
|
|
|
'minutes-from-dateTime', |
134
|
|
|
|
|
|
|
'minutes-from-duration', |
135
|
|
|
|
|
|
|
'minutes-from-time', |
136
|
|
|
|
|
|
|
'month-from-date', |
137
|
|
|
|
|
|
|
'month-from-dateTime', |
138
|
|
|
|
|
|
|
'months-from-duration', |
139
|
|
|
|
|
|
|
'namespace-uri-for-prefix', |
140
|
|
|
|
|
|
|
'namespace-uri-from-QName', |
141
|
|
|
|
|
|
|
'node-kind', |
142
|
|
|
|
|
|
|
'node-name', |
143
|
|
|
|
|
|
|
'normalize-unicode', |
144
|
|
|
|
|
|
|
'one-or-more', |
145
|
|
|
|
|
|
|
'regex-group', |
146
|
|
|
|
|
|
|
'remove', |
147
|
|
|
|
|
|
|
'replace', |
148
|
|
|
|
|
|
|
'resolve-QName', |
149
|
|
|
|
|
|
|
'resolve-uri', |
150
|
|
|
|
|
|
|
'reverse', |
151
|
|
|
|
|
|
|
'root', |
152
|
|
|
|
|
|
|
'round-half-to-even', |
153
|
|
|
|
|
|
|
'seconds-from-dateTime', |
154
|
|
|
|
|
|
|
'seconds-from-duration', |
155
|
|
|
|
|
|
|
'seconds-from-time', |
156
|
|
|
|
|
|
|
'sequence-node-identical', |
157
|
|
|
|
|
|
|
'static-base-uri', |
158
|
|
|
|
|
|
|
'string-join', |
159
|
|
|
|
|
|
|
'string-to-codepoints', |
160
|
|
|
|
|
|
|
'subsequence', |
161
|
|
|
|
|
|
|
'subtract-dateTimes-yielding-dayTimeDuration', |
162
|
|
|
|
|
|
|
'subtract-dateTimes-yielding-yearMonthDuration', |
163
|
|
|
|
|
|
|
'subtract-dates-yielding-dayTimeDuration', |
164
|
|
|
|
|
|
|
'subtract-dates-yielding-yearMonthDuration', |
165
|
|
|
|
|
|
|
'timezone-from-date', |
166
|
|
|
|
|
|
|
'timezone-from-dateTime', |
167
|
|
|
|
|
|
|
'timezone-from-time', |
168
|
|
|
|
|
|
|
'tokenize', |
169
|
|
|
|
|
|
|
'trace', |
170
|
|
|
|
|
|
|
'unordered', |
171
|
|
|
|
|
|
|
'unparsed-entity-public-id', |
172
|
|
|
|
|
|
|
'unparsed-text', |
173
|
|
|
|
|
|
|
'upper-case', |
174
|
|
|
|
|
|
|
'year-from-date', |
175
|
|
|
|
|
|
|
'year-from-dateTime', |
176
|
|
|
|
|
|
|
'years-from-duration', |
177
|
|
|
|
|
|
|
'zero-or-one', |
178
|
|
|
|
|
|
|
); |
179
|
2
|
|
|
|
|
8
|
$self->listAdd('keytags', |
180
|
|
|
|
|
|
|
'xsl:apply-imports', |
181
|
|
|
|
|
|
|
'xsl:apply-templates', |
182
|
|
|
|
|
|
|
'xsl:attribute', |
183
|
|
|
|
|
|
|
'xsl:attribute-set', |
184
|
|
|
|
|
|
|
'xsl:call-template', |
185
|
|
|
|
|
|
|
'xsl:choose', |
186
|
|
|
|
|
|
|
'xsl:comment', |
187
|
|
|
|
|
|
|
'xsl:copy', |
188
|
|
|
|
|
|
|
'xsl:copy-of', |
189
|
|
|
|
|
|
|
'xsl:decimal-format', |
190
|
|
|
|
|
|
|
'xsl:element', |
191
|
|
|
|
|
|
|
'xsl:fallback', |
192
|
|
|
|
|
|
|
'xsl:for-each', |
193
|
|
|
|
|
|
|
'xsl:if', |
194
|
|
|
|
|
|
|
'xsl:import', |
195
|
|
|
|
|
|
|
'xsl:include', |
196
|
|
|
|
|
|
|
'xsl:key', |
197
|
|
|
|
|
|
|
'xsl:message', |
198
|
|
|
|
|
|
|
'xsl:namespace-alias', |
199
|
|
|
|
|
|
|
'xsl:number', |
200
|
|
|
|
|
|
|
'xsl:otherwise', |
201
|
|
|
|
|
|
|
'xsl:output', |
202
|
|
|
|
|
|
|
'xsl:param', |
203
|
|
|
|
|
|
|
'xsl:preserve-space', |
204
|
|
|
|
|
|
|
'xsl:processing-instruction', |
205
|
|
|
|
|
|
|
'xsl:sort', |
206
|
|
|
|
|
|
|
'xsl:strip-space', |
207
|
|
|
|
|
|
|
'xsl:stylesheet', |
208
|
|
|
|
|
|
|
'xsl:template', |
209
|
|
|
|
|
|
|
'xsl:text', |
210
|
|
|
|
|
|
|
'xsl:transform', |
211
|
|
|
|
|
|
|
'xsl:value-of', |
212
|
|
|
|
|
|
|
'xsl:variable', |
213
|
|
|
|
|
|
|
'xsl:when', |
214
|
|
|
|
|
|
|
'xsl:with-param', |
215
|
|
|
|
|
|
|
); |
216
|
2
|
|
|
|
|
9
|
$self->listAdd('keytags_2.0', |
217
|
|
|
|
|
|
|
'xsl:analyze-string', |
218
|
|
|
|
|
|
|
'xsl:character-map', |
219
|
|
|
|
|
|
|
'xsl:document', |
220
|
|
|
|
|
|
|
'xsl:for-each-group', |
221
|
|
|
|
|
|
|
'xsl:function', |
222
|
|
|
|
|
|
|
'xsl:import-schema', |
223
|
|
|
|
|
|
|
'xsl:matching-substring', |
224
|
|
|
|
|
|
|
'xsl:namespace', |
225
|
|
|
|
|
|
|
'xsl:next-match', |
226
|
|
|
|
|
|
|
'xsl:non-matching-substring', |
227
|
|
|
|
|
|
|
'xsl:output-character', |
228
|
|
|
|
|
|
|
'xsl:perform-sort', |
229
|
|
|
|
|
|
|
'xsl:result-document', |
230
|
|
|
|
|
|
|
'xsl:sequence', |
231
|
|
|
|
|
|
|
); |
232
|
2
|
|
|
|
|
61
|
$self->contextdata({ |
233
|
|
|
|
|
|
|
'attrValue' => { |
234
|
|
|
|
|
|
|
callback => \&parseattrValue, |
235
|
|
|
|
|
|
|
attribute => 'Invalid', |
236
|
|
|
|
|
|
|
}, |
237
|
|
|
|
|
|
|
'attributes' => { |
238
|
|
|
|
|
|
|
callback => \&parseattributes, |
239
|
|
|
|
|
|
|
attribute => 'Attribute', |
240
|
|
|
|
|
|
|
}, |
241
|
|
|
|
|
|
|
'comment' => { |
242
|
|
|
|
|
|
|
callback => \&parsecomment, |
243
|
|
|
|
|
|
|
attribute => 'Comment', |
244
|
|
|
|
|
|
|
}, |
245
|
|
|
|
|
|
|
'detectEntRef' => { |
246
|
|
|
|
|
|
|
callback => \&parsedetectEntRef, |
247
|
|
|
|
|
|
|
attribute => 'Normal Text', |
248
|
|
|
|
|
|
|
}, |
249
|
|
|
|
|
|
|
'normalText' => { |
250
|
|
|
|
|
|
|
callback => \&parsenormalText, |
251
|
|
|
|
|
|
|
attribute => 'Normal Text', |
252
|
|
|
|
|
|
|
}, |
253
|
|
|
|
|
|
|
'sqstring' => { |
254
|
|
|
|
|
|
|
callback => \&parsesqstring, |
255
|
|
|
|
|
|
|
attribute => 'Attribute Value', |
256
|
|
|
|
|
|
|
}, |
257
|
|
|
|
|
|
|
'sqxpath' => { |
258
|
|
|
|
|
|
|
callback => \&parsesqxpath, |
259
|
|
|
|
|
|
|
attribute => 'XPath', |
260
|
|
|
|
|
|
|
}, |
261
|
|
|
|
|
|
|
'sqxpathstring' => { |
262
|
|
|
|
|
|
|
callback => \&parsesqxpathstring, |
263
|
|
|
|
|
|
|
attribute => 'XPath String', |
264
|
|
|
|
|
|
|
}, |
265
|
|
|
|
|
|
|
'string' => { |
266
|
|
|
|
|
|
|
callback => \&parsestring, |
267
|
|
|
|
|
|
|
attribute => 'Attribute Value', |
268
|
|
|
|
|
|
|
}, |
269
|
|
|
|
|
|
|
'tagname' => { |
270
|
|
|
|
|
|
|
callback => \&parsetagname, |
271
|
|
|
|
|
|
|
attribute => 'Tag', |
272
|
|
|
|
|
|
|
}, |
273
|
|
|
|
|
|
|
'xattrValue' => { |
274
|
|
|
|
|
|
|
callback => \&parsexattrValue, |
275
|
|
|
|
|
|
|
attribute => 'Invalid', |
276
|
|
|
|
|
|
|
}, |
277
|
|
|
|
|
|
|
'xattributes' => { |
278
|
|
|
|
|
|
|
callback => \&parsexattributes, |
279
|
|
|
|
|
|
|
attribute => 'Attribute', |
280
|
|
|
|
|
|
|
}, |
281
|
|
|
|
|
|
|
'xpath' => { |
282
|
|
|
|
|
|
|
callback => \&parsexpath, |
283
|
|
|
|
|
|
|
attribute => 'XPath', |
284
|
|
|
|
|
|
|
}, |
285
|
|
|
|
|
|
|
'xpathstring' => { |
286
|
|
|
|
|
|
|
callback => \&parsexpathstring, |
287
|
|
|
|
|
|
|
attribute => 'XPath String', |
288
|
|
|
|
|
|
|
}, |
289
|
|
|
|
|
|
|
}); |
290
|
2
|
|
|
|
|
16
|
$self->deliminators('\\s||\\.|\\(|\\)|\\!|\\+|,|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|-|:'); |
291
|
2
|
|
|
|
|
9
|
$self->basecontext('normalText'); |
292
|
2
|
|
|
|
|
12
|
$self->keywordscase(0); |
293
|
2
|
|
|
|
|
8
|
$self->initialize; |
294
|
2
|
|
|
|
|
6
|
bless ($self, $class); |
295
|
2
|
|
|
|
|
12
|
return $self; |
296
|
|
|
|
|
|
|
} |
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
sub language { |
299
|
0
|
|
|
0
|
0
|
0
|
return 'xslt'; |
300
|
|
|
|
|
|
|
} |
301
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
sub parseattrValue { |
303
|
100
|
|
|
100
|
0
|
245
|
my ($self, $text) = @_; |
304
|
|
|
|
|
|
|
# attribute => 'Invalid' |
305
|
|
|
|
|
|
|
# char => '/' |
306
|
|
|
|
|
|
|
# char1 => '>' |
307
|
|
|
|
|
|
|
# context => '#pop#pop#pop' |
308
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
309
|
100
|
50
|
|
|
|
460
|
if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Invalid')) { |
310
|
0
|
|
|
|
|
0
|
return 1 |
311
|
|
|
|
|
|
|
} |
312
|
|
|
|
|
|
|
# attribute => 'Invalid' |
313
|
|
|
|
|
|
|
# char => '>' |
314
|
|
|
|
|
|
|
# context => '#pop#pop#pop' |
315
|
|
|
|
|
|
|
# type => 'DetectChar' |
316
|
100
|
50
|
|
|
|
430
|
if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Invalid')) { |
317
|
0
|
|
|
|
|
0
|
return 1 |
318
|
|
|
|
|
|
|
} |
319
|
|
|
|
|
|
|
# attribute => 'Attribute Value' |
320
|
|
|
|
|
|
|
# char => '"' |
321
|
|
|
|
|
|
|
# context => 'string' |
322
|
|
|
|
|
|
|
# type => 'DetectChar' |
323
|
100
|
50
|
|
|
|
371
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'Attribute Value')) { |
324
|
100
|
|
|
|
|
297
|
return 1 |
325
|
|
|
|
|
|
|
} |
326
|
|
|
|
|
|
|
# attribute => 'Attribute Value' |
327
|
|
|
|
|
|
|
# char => ''' |
328
|
|
|
|
|
|
|
# context => 'sqstring' |
329
|
|
|
|
|
|
|
# type => 'DetectChar' |
330
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'sqstring', 'Attribute Value')) { |
331
|
0
|
|
|
|
|
0
|
return 1 |
332
|
|
|
|
|
|
|
} |
333
|
0
|
|
|
|
|
0
|
return 0; |
334
|
|
|
|
|
|
|
}; |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
sub parseattributes { |
337
|
774
|
|
|
774
|
0
|
1205
|
my ($self, $text) = @_; |
338
|
|
|
|
|
|
|
# attribute => 'Tag' |
339
|
|
|
|
|
|
|
# char => '/' |
340
|
|
|
|
|
|
|
# char1 => '>' |
341
|
|
|
|
|
|
|
# context => '#pop#pop' |
342
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
343
|
774
|
100
|
|
|
|
2596
|
if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop#pop', 'Tag')) { |
344
|
38
|
|
|
|
|
405
|
return 1 |
345
|
|
|
|
|
|
|
} |
346
|
|
|
|
|
|
|
# attribute => 'Tag' |
347
|
|
|
|
|
|
|
# char => '>' |
348
|
|
|
|
|
|
|
# context => '#pop#pop' |
349
|
|
|
|
|
|
|
# type => 'DetectChar' |
350
|
736
|
100
|
|
|
|
2514
|
if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop#pop', 'Tag')) { |
351
|
36
|
|
|
|
|
110
|
return 1 |
352
|
|
|
|
|
|
|
} |
353
|
|
|
|
|
|
|
# String => '\s*=\s*' |
354
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
355
|
|
|
|
|
|
|
# context => 'attrValue' |
356
|
|
|
|
|
|
|
# type => 'RegExpr' |
357
|
700
|
100
|
|
|
|
2129
|
if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'attrValue', 'Normal Text')) { |
358
|
100
|
|
|
|
|
304
|
return 1 |
359
|
|
|
|
|
|
|
} |
360
|
600
|
|
|
|
|
1572
|
return 0; |
361
|
|
|
|
|
|
|
}; |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
sub parsecomment { |
364
|
710
|
|
|
710
|
0
|
1259
|
my ($self, $text) = @_; |
365
|
|
|
|
|
|
|
# String => '-->' |
366
|
|
|
|
|
|
|
# attribute => 'Comment' |
367
|
|
|
|
|
|
|
# context => '#pop' |
368
|
|
|
|
|
|
|
# endRegion => 'comment' |
369
|
|
|
|
|
|
|
# type => 'StringDetect' |
370
|
710
|
100
|
|
|
|
2183
|
if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'Comment')) { |
371
|
10
|
|
|
|
|
32
|
return 1 |
372
|
|
|
|
|
|
|
} |
373
|
|
|
|
|
|
|
# String => '-(-(?!->))+' |
374
|
|
|
|
|
|
|
# attribute => 'Invalid' |
375
|
|
|
|
|
|
|
# context => '#stay' |
376
|
|
|
|
|
|
|
# type => 'RegExpr' |
377
|
700
|
50
|
|
|
|
2123
|
if ($self->testRegExpr($text, '-(-(?!->))+', 0, 0, 0, undef, 0, '#stay', 'Invalid')) { |
378
|
0
|
|
|
|
|
0
|
return 1 |
379
|
|
|
|
|
|
|
} |
380
|
|
|
|
|
|
|
# String => '(FIXME|TODO|HACK)' |
381
|
|
|
|
|
|
|
# attribute => 'Alert' |
382
|
|
|
|
|
|
|
# context => '#stay' |
383
|
|
|
|
|
|
|
# type => 'RegExpr' |
384
|
700
|
100
|
|
|
|
2255
|
if ($self->testRegExpr($text, '(FIXME|TODO|HACK)', 0, 0, 0, undef, 0, '#stay', 'Alert')) { |
385
|
2
|
|
|
|
|
7
|
return 1 |
386
|
|
|
|
|
|
|
} |
387
|
698
|
|
|
|
|
1894
|
return 0; |
388
|
|
|
|
|
|
|
}; |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
sub parsedetectEntRef { |
391
|
1860
|
|
|
1860
|
0
|
2468
|
my ($self, $text) = @_; |
392
|
|
|
|
|
|
|
# String => '&(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z_:][\w.:_-]*);' |
393
|
|
|
|
|
|
|
# attribute => 'Entity Reference' |
394
|
|
|
|
|
|
|
# context => '#stay' |
395
|
|
|
|
|
|
|
# type => 'RegExpr' |
396
|
1860
|
50
|
|
|
|
5791
|
if ($self->testRegExpr($text, '&(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z_:][\\w.:_-]*);', 0, 0, 0, undef, 0, '#stay', 'Entity Reference')) { |
397
|
0
|
|
|
|
|
0
|
return 1 |
398
|
|
|
|
|
|
|
} |
399
|
1860
|
|
|
|
|
10895
|
return 0; |
400
|
|
|
|
|
|
|
}; |
401
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
sub parsenormalText { |
403
|
852
|
|
|
852
|
0
|
1318
|
my ($self, $text) = @_; |
404
|
|
|
|
|
|
|
# String => ' |