Commit | Line | Data |
3fea05b9 |
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 'asp.xml' file of the syntax highlight |
6 | # engine of the kate text editor (http://www.kate-editor.org |
7 | |
8 | #kate xml version 1.02 |
9 | #kate version 2.1 |
10 | #kate author Antonio Salazar (savedfastcool@gmail.com) |
11 | #generated: Sun Feb 3 22:02:04 2008, localtime |
12 | |
13 | package Syntax::Highlight::Engine::Kate::ASP; |
14 | |
15 | our $VERSION = '0.06'; |
16 | |
17 | use strict; |
18 | use warnings; |
19 | use base('Syntax::Highlight::Engine::Kate::Template'); |
20 | |
21 | sub new { |
22 | my $proto = shift; |
23 | my $class = ref($proto) || $proto; |
24 | my $self = $class->SUPER::new(@_); |
25 | $self->attributes({ |
26 | 'ASP Text' => 'Normal', |
27 | 'Comment' => 'Comment', |
28 | 'Control Structures' => 'Operator', |
29 | 'Decimal' => 'DecVal', |
30 | 'Escape Code' => 'Char', |
31 | 'Float' => 'Float', |
32 | 'Function' => 'Function', |
33 | 'HTML Comment' => 'Comment', |
34 | 'HTML Tag' => 'BString', |
35 | 'Hex' => 'BaseN', |
36 | 'Identifier' => 'Others', |
37 | 'Keyword' => 'Keyword', |
38 | 'Normal Text' => 'Normal', |
39 | 'Octal' => 'BaseN', |
40 | 'Other' => 'Others', |
41 | 'String' => 'String', |
42 | 'Types' => 'DataType', |
43 | 'Variable' => 'Variable', |
44 | }); |
45 | $self->listAdd('control structures', |
46 | 'case', |
47 | 'continue', |
48 | 'do', |
49 | 'each', |
50 | 'else', |
51 | 'elseif', |
52 | 'end if', |
53 | 'end select', |
54 | 'exit', |
55 | 'for', |
56 | 'if', |
57 | 'in', |
58 | 'loop', |
59 | 'next', |
60 | 'select', |
61 | 'then', |
62 | 'to', |
63 | 'until', |
64 | 'wend', |
65 | 'while', |
66 | ); |
67 | $self->listAdd('functions', |
68 | 'Add', |
69 | 'AddFolders', |
70 | 'BuildPath', |
71 | 'Clear', |
72 | 'Close', |
73 | 'Copy', |
74 | 'CopyFile', |
75 | 'CopyFolder', |
76 | 'CreateFolder', |
77 | 'CreateTextFile', |
78 | 'Date', |
79 | 'DateDiff', |
80 | 'DatePart', |
81 | 'DateSerial', |
82 | 'DateValue', |
83 | 'Day', |
84 | 'Delete', |
85 | 'DeleteFile', |
86 | 'DeleteFolder', |
87 | 'DriveExists', |
88 | 'Exists', |
89 | 'Exp', |
90 | 'FileExists', |
91 | 'Filter', |
92 | 'Fix', |
93 | 'FolderExists', |
94 | 'FormatCurrency', |
95 | 'FormatDateTime', |
96 | 'FormatNumber', |
97 | 'FormatPercent', |
98 | 'GetAbsolutePathName', |
99 | 'GetBaseName', |
100 | 'GetDrive', |
101 | 'GetDriveName', |
102 | 'GetExtensionName', |
103 | 'GetFile', |
104 | 'GetFileName', |
105 | 'GetFolder', |
106 | 'GetObject', |
107 | 'GetParentFolderName', |
108 | 'GetSpecialFolder', |
109 | 'GetTempName', |
110 | 'Hex', |
111 | 'Hour', |
112 | 'InStr', |
113 | 'InStrRev', |
114 | 'InputBox', |
115 | 'Int', |
116 | 'IsArray', |
117 | 'IsDate', |
118 | 'IsEmpty', |
119 | 'IsNull', |
120 | 'IsNumeric', |
121 | 'IsObject', |
122 | 'Items', |
123 | 'Join', |
124 | 'Keys', |
125 | 'LBound', |
126 | 'LCase', |
127 | 'LTrim', |
128 | 'Left', |
129 | 'Len', |
130 | 'LoadPicture', |
131 | 'Log', |
132 | 'Mid', |
133 | 'Minute', |
134 | 'Month', |
135 | 'MonthName', |
136 | 'Move', |
137 | 'MoveFile', |
138 | 'MoveFolder', |
139 | 'MsgBox', |
140 | 'Now', |
141 | 'Oct', |
142 | 'OpenAsTextStream', |
143 | 'OpenTextFile', |
144 | 'RGB', |
145 | 'RTrim', |
146 | 'Raise', |
147 | 'Read', |
148 | 'ReadAll', |
149 | 'ReadLine', |
150 | 'Remove', |
151 | 'RemoveAll', |
152 | 'Replace', |
153 | 'Right', |
154 | 'Rnd', |
155 | 'Round', |
156 | 'ScriptEngine', |
157 | 'ScriptEngineBuildVersion', |
158 | 'ScriptEngineMajorVersion', |
159 | 'ScriptEngineMinorVersion', |
160 | 'Second', |
161 | 'Sgn', |
162 | 'Sin', |
163 | 'Skip', |
164 | 'SkipLine', |
165 | 'Space', |
166 | 'Split', |
167 | 'Sqr', |
168 | 'StrComp', |
169 | 'StrReverse', |
170 | 'String', |
171 | 'Tan', |
172 | 'Time', |
173 | 'TimeSerial', |
174 | 'TimeValue', |
175 | 'Timer', |
176 | 'Trim', |
177 | 'TypeName', |
178 | 'UBound', |
179 | 'UCase', |
180 | 'VarType', |
181 | 'Weekday', |
182 | 'WeekdayName', |
183 | 'Write', |
184 | 'WriteBlankLines', |
185 | 'WriteLine', |
186 | 'Year', |
187 | 'abs', |
188 | 'array', |
189 | 'asc', |
190 | 'atn', |
191 | 'cbool', |
192 | 'cbyte', |
193 | 'ccur', |
194 | 'cdate', |
195 | 'cdbl', |
196 | 'chr', |
197 | 'cint', |
198 | 'clng', |
199 | 'cookies', |
200 | 'cos', |
201 | 'createobject', |
202 | 'csng', |
203 | 'cstr', |
204 | 'date', |
205 | 'dateadd', |
206 | 'end', |
207 | 'form', |
208 | 'item', |
209 | 'querystring', |
210 | 'redirect', |
211 | 'request', |
212 | 'response', |
213 | 'server', |
214 | 'servervariables', |
215 | 'session', |
216 | 'write', |
217 | ); |
218 | $self->listAdd('keywords', |
219 | 'and', |
220 | 'call', |
221 | 'class', |
222 | 'close', |
223 | 'const', |
224 | 'dim', |
225 | 'eof', |
226 | 'erase', |
227 | 'execute', |
228 | 'false', |
229 | 'function', |
230 | 'me', |
231 | 'movenext', |
232 | 'new', |
233 | 'not', |
234 | 'nothing', |
235 | 'open', |
236 | 'or', |
237 | 'preserve', |
238 | 'private', |
239 | 'public', |
240 | 'randomize', |
241 | 'redim', |
242 | 'set', |
243 | 'sub', |
244 | 'true', |
245 | 'with', |
246 | 'xor', |
247 | ); |
248 | $self->contextdata({ |
249 | 'asp_onelinecomment' => { |
250 | callback => \&parseasp_onelinecomment, |
251 | attribute => 'Comment', |
252 | lineending => '#pop', |
253 | }, |
254 | 'aspsource' => { |
255 | callback => \&parseaspsource, |
256 | attribute => 'ASP Text', |
257 | }, |
258 | 'doublequotestring' => { |
259 | callback => \&parsedoublequotestring, |
260 | attribute => 'String', |
261 | }, |
262 | 'htmlcomment' => { |
263 | callback => \&parsehtmlcomment, |
264 | attribute => 'HTML Comment', |
265 | }, |
266 | 'htmltag' => { |
267 | callback => \&parsehtmltag, |
268 | attribute => 'Identifier', |
269 | }, |
270 | 'identifiers' => { |
271 | callback => \&parseidentifiers, |
272 | attribute => 'Identifier', |
273 | }, |
274 | 'nosource' => { |
275 | callback => \&parsenosource, |
276 | attribute => 'Normal Text', |
277 | }, |
278 | 'scripts' => { |
279 | callback => \&parsescripts, |
280 | attribute => 'Normal Text', |
281 | }, |
282 | 'scripts_onelinecomment' => { |
283 | callback => \&parsescripts_onelinecomment, |
284 | attribute => 'Comment', |
285 | lineending => '#pop', |
286 | }, |
287 | 'singlequotestring' => { |
288 | callback => \&parsesinglequotestring, |
289 | attribute => 'String', |
290 | }, |
291 | 'twolinecomment' => { |
292 | callback => \&parsetwolinecomment, |
293 | attribute => 'Comment', |
294 | }, |
295 | 'types1' => { |
296 | callback => \&parsetypes1, |
297 | attribute => 'Types', |
298 | }, |
299 | 'types2' => { |
300 | callback => \&parsetypes2, |
301 | attribute => 'Types', |
302 | }, |
303 | }); |
304 | $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
305 | $self->basecontext('nosource'); |
306 | $self->keywordscase(0); |
307 | $self->initialize; |
308 | bless ($self, $class); |
309 | return $self; |
310 | } |
311 | |
312 | sub language { |
313 | return 'ASP'; |
314 | } |
315 | |
316 | sub parseasp_onelinecomment { |
317 | my ($self, $text) = @_; |
318 | # String => '%>' |
319 | # attribute => 'Keyword' |
320 | # context => '#pop#pop' |
321 | # type => 'StringDetect' |
322 | if ($self->testStringDetect($text, '%>', 0, 0, 0, undef, 0, '#pop#pop', 'Keyword')) { |
323 | return 1 |
324 | } |
325 | return 0; |
326 | }; |
327 | |
328 | sub parseaspsource { |
329 | my ($self, $text) = @_; |
330 | # String => '%>' |
331 | # attribute => 'Keyword' |
332 | # context => '#pop' |
333 | # type => 'StringDetect' |
334 | if ($self->testStringDetect($text, '%>', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { |
335 | return 1 |
336 | } |
337 | # attribute => 'Comment' |
338 | # char => ''' |
339 | # context => 'asp_onelinecomment' |
340 | # type => 'DetectChar' |
341 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'asp_onelinecomment', 'Comment')) { |
342 | return 1 |
343 | } |
344 | # attribute => 'String' |
345 | # char => '"' |
346 | # context => 'doublequotestring' |
347 | # type => 'DetectChar' |
348 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'doublequotestring', 'String')) { |
349 | return 1 |
350 | } |
351 | # attribute => 'String' |
352 | # char => ''' |
353 | # context => 'singlequotestring' |
354 | # type => 'DetectChar' |
355 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'singlequotestring', 'String')) { |
356 | return 1 |
357 | } |
358 | # attribute => 'Keyword' |
359 | # char => '&' |
360 | # context => '#stay' |
361 | # type => 'DetectChar' |
362 | if ($self->testDetectChar($text, '&', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { |
363 | return 1 |
364 | } |
365 | # String => '' |
366 | # attribute => 'String' |
367 | # context => '' |
368 | # type => 'RegExpr' |
369 | if ($self->testRegExpr($text, '', 0, 0, 0, undef, 0, '', 'String')) { |
370 | return 1 |
371 | } |
372 | # String => '[0123456789]*\.\.\.[0123456789]*' |
373 | # attribute => 'String' |
374 | # context => '#stay' |
375 | # type => 'RegExpr' |
376 | if ($self->testRegExpr($text, '[0123456789]*\\.\\.\\.[0123456789]*', 0, 0, 0, undef, 0, '#stay', 'String')) { |
377 | return 1 |
378 | } |
379 | # attribute => 'Octal' |
380 | # context => '#stay' |
381 | # type => 'HlCOct' |
382 | if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { |
383 | return 1 |
384 | } |
385 | # attribute => 'Hex' |
386 | # context => '#stay' |
387 | # type => 'HlCHex' |
388 | if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { |
389 | return 1 |
390 | } |
391 | # attribute => 'Float' |
392 | # context => '#stay' |
393 | # type => 'Float' |
394 | if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { |
395 | return 1 |
396 | } |
397 | # attribute => 'Decimal' |
398 | # context => '#stay' |
399 | # type => 'Int' |
400 | if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { |
401 | return 1 |
402 | } |
403 | # String => ';()}{:,[]' |
404 | # attribute => 'Other' |
405 | # context => '#stay' |
406 | # type => 'AnyChar' |
407 | if ($self->testAnyChar($text, ';()}{:,[]', 0, 0, undef, 0, '#stay', 'Other')) { |
408 | return 1 |
409 | } |
410 | # String => '\belseif\b' |
411 | # attribute => 'Control Structures' |
412 | # beginRegion => 'iffi1' |
413 | # context => '#stay' |
414 | # endRegion => 'iffi1' |
415 | # insensitive => 'TRUE' |
416 | # type => 'RegExpr' |
417 | if ($self->testRegExpr($text, '\\belseif\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { |
418 | return 1 |
419 | } |
420 | # String => '\belse\b' |
421 | # attribute => 'Control Structures' |
422 | # beginRegion => 'iffi1' |
423 | # context => '#stay' |
424 | # endRegion => 'iffi1' |
425 | # insensitive => 'TRUE' |
426 | # type => 'RegExpr' |
427 | if ($self->testRegExpr($text, '\\belse\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { |
428 | return 1 |
429 | } |
430 | # String => '\bif\b' |
431 | # attribute => 'Control Structures' |
432 | # beginRegion => 'iffi1' |
433 | # context => '#stay' |
434 | # insensitive => 'TRUE' |
435 | # type => 'RegExpr' |
436 | if ($self->testRegExpr($text, '\\bif\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { |
437 | return 1 |
438 | } |
439 | # String => '\bend if\b' |
440 | # attribute => 'Control Structures' |
441 | # context => '#stay' |
442 | # endRegion => 'iffi1' |
443 | # insensitive => 'TRUE' |
444 | # type => 'RegExpr' |
445 | if ($self->testRegExpr($text, '\\bend if\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { |
446 | return 1 |
447 | } |
448 | # String => '\bexit function\b' |
449 | # attribute => 'Keyword' |
450 | # context => '#stay' |
451 | # insensitive => 'TRUE' |
452 | # type => 'RegExpr' |
453 | if ($self->testRegExpr($text, '\\bexit function\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { |
454 | return 1 |
455 | } |
456 | # String => '\bfunction\b' |
457 | # attribute => 'Keyword' |
458 | # beginRegion => 'funendfun1' |
459 | # context => '#stay' |
460 | # insensitive => 'TRUE' |
461 | # type => 'RegExpr' |
462 | if ($self->testRegExpr($text, '\\bfunction\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { |
463 | return 1 |
464 | } |
465 | # String => '\bend function\b' |
466 | # attribute => 'Keyword' |
467 | # context => '#stay' |
468 | # endRegion => 'funendfun1' |
469 | # insensitive => 'TRUE' |
470 | # type => 'RegExpr' |
471 | if ($self->testRegExpr($text, '\\bend function\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { |
472 | return 1 |
473 | } |
474 | # String => '\bexit sub\b' |
475 | # attribute => 'Keyword' |
476 | # context => '#stay' |
477 | # insensitive => 'TRUE' |
478 | # type => 'RegExpr' |
479 | if ($self->testRegExpr($text, '\\bexit sub\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { |
480 | return 1 |
481 | } |
482 | # String => '\bsub\b' |
483 | # attribute => 'Keyword' |
484 | # beginRegion => 'subendsub1' |
485 | # context => '#stay' |
486 | # insensitive => 'TRUE' |
487 | # type => 'RegExpr' |
488 | if ($self->testRegExpr($text, '\\bsub\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { |
489 | return 1 |
490 | } |
491 | # String => '\bend sub\b' |
492 | # attribute => 'Keyword' |
493 | # context => '#stay' |
494 | # endRegion => 'subendsub1' |
495 | # insensitive => 'TRUE' |
496 | # type => 'RegExpr' |
497 | if ($self->testRegExpr($text, '\\bend sub\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { |
498 | return 1 |
499 | } |
500 | # String => '\bclass\b' |
501 | # attribute => 'Keyword' |
502 | # beginRegion => 'classendclass1' |
503 | # context => '#stay' |
504 | # insensitive => 'TRUE' |
505 | # type => 'RegExpr' |
506 | if ($self->testRegExpr($text, '\\bclass\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { |
507 | return 1 |
508 | } |
509 | # String => '\bend class\b' |
510 | # attribute => 'Keyword' |
511 | # context => '#stay' |
512 | # endRegion => 'classendclass1' |
513 | # insensitive => 'TRUE' |
514 | # type => 'RegExpr' |
515 | if ($self->testRegExpr($text, '\\bend class\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) { |
516 | return 1 |
517 | } |
518 | # String => '\bexit do\b' |
519 | # attribute => 'Control Structures' |
520 | # context => '#stay' |
521 | # insensitive => 'TRUE' |
522 | # type => 'RegExpr' |
523 | if ($self->testRegExpr($text, '\\bexit do\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { |
524 | return 1 |
525 | } |
526 | # String => '\bdo\b' |
527 | # attribute => 'Control Structures' |
528 | # beginRegion => 'doloop1' |
529 | # context => '#stay' |
530 | # insensitive => 'TRUE' |
531 | # type => 'RegExpr' |
532 | if ($self->testRegExpr($text, '\\bdo\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { |
533 | return 1 |
534 | } |
535 | # String => '\bloop\b' |
536 | # attribute => 'Control Structures' |
537 | # context => '#stay' |
538 | # endRegion => 'doloop1' |
539 | # insensitive => 'TRUE' |
540 | # type => 'RegExpr' |
541 | if ($self->testRegExpr($text, '\\bloop\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { |
542 | return 1 |
543 | } |
544 | # String => '\bexit while\b' |
545 | # attribute => 'Control Structures' |
546 | # context => '#stay' |
547 | # insensitive => 'TRUE' |
548 | # type => 'RegExpr' |
549 | if ($self->testRegExpr($text, '\\bexit while\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { |
550 | return 1 |
551 | } |
552 | # String => '\bwhile\b' |
553 | # attribute => 'Control Structures' |
554 | # beginRegion => 'whilewend1' |
555 | # context => '#stay' |
556 | # insensitive => 'TRUE' |
557 | # type => 'RegExpr' |
558 | if ($self->testRegExpr($text, '\\bwhile\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { |
559 | return 1 |
560 | } |
561 | # String => '\bwend\b' |
562 | # attribute => 'Control Structures' |
563 | # context => '#stay' |
564 | # endRegion => 'whilewend1' |
565 | # insensitive => 'TRUE' |
566 | # type => 'RegExpr' |
567 | if ($self->testRegExpr($text, '\\bwend\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { |
568 | return 1 |
569 | } |
570 | # String => '\bexit for\b' |
571 | # attribute => 'Control Structures' |
572 | # context => '#stay' |
573 | # insensitive => 'TRUE' |
574 | # type => 'RegExpr' |
575 | if ($self->testRegExpr($text, '\\bexit for\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { |
576 | return 1 |
577 | } |
578 | # String => '\bfor\b' |
579 | # attribute => 'Control Structures' |
580 | # beginRegion => 'fornext1' |
581 | # context => '#stay' |
582 | # insensitive => 'TRUE' |
583 | # type => 'RegExpr' |
584 | if ($self->testRegExpr($text, '\\bfor\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { |
585 | return 1 |
586 | } |
587 | # String => '\bnext\b' |
588 | # attribute => 'Control Structures' |
589 | # context => '#stay' |
590 | # endRegion => 'fornext1' |
591 | # insensitive => 'TRUE' |
592 | # type => 'RegExpr' |
593 | if ($self->testRegExpr($text, '\\bnext\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { |
594 | return 1 |
595 | } |
596 | # String => '\bselect case\b' |
597 | # attribute => 'Control Structures' |
598 | # beginRegion => 'selcase1' |
599 | # context => '#stay' |
600 | # insensitive => 'TRUE' |
601 | # type => 'RegExpr' |
602 | if ($self->testRegExpr($text, '\\bselect case\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { |
603 | return 1 |
604 | } |
605 | # String => '\bend select\b' |
606 | # attribute => 'Control Structures' |
607 | # context => '#stay' |
608 | # endRegion => 'selcase1' |
609 | # insensitive => 'TRUE' |
610 | # type => 'RegExpr' |
611 | if ($self->testRegExpr($text, '\\bend select\\b', 1, 0, 0, undef, 0, '#stay', 'Control Structures')) { |
612 | return 1 |
613 | } |
614 | # String => 'keywords' |
615 | # attribute => 'Keyword' |
616 | # context => '#stay' |
617 | # type => 'keyword' |
618 | if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { |
619 | return 1 |
620 | } |
621 | # String => 'control structures' |
622 | # attribute => 'Control Structures' |
623 | # context => '#stay' |
624 | # type => 'keyword' |
625 | if ($self->testKeyword($text, 'control structures', 0, undef, 0, '#stay', 'Control Structures')) { |
626 | return 1 |
627 | } |
628 | # String => 'functions' |
629 | # attribute => 'Function' |
630 | # context => '#stay' |
631 | # type => 'keyword' |
632 | if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) { |
633 | return 1 |
634 | } |
635 | return 0; |
636 | }; |
637 | |
638 | sub parsedoublequotestring { |
639 | my ($self, $text) = @_; |
640 | # attribute => 'Escape Code' |
641 | # char => '"' |
642 | # char1 => '"' |
643 | # context => '#stay' |
644 | # type => 'Detect2Chars' |
645 | if ($self->testDetect2Chars($text, '"', '"', 0, 0, 0, undef, 0, '#stay', 'Escape Code')) { |
646 | return 1 |
647 | } |
648 | # String => '\\[0-7]{1,3}' |
649 | # attribute => 'Escape Code' |
650 | # context => '#stay' |
651 | # type => 'RegExpr' |
652 | if ($self->testRegExpr($text, '\\\\[0-7]{1,3}', 0, 0, 0, undef, 0, '#stay', 'Escape Code')) { |
653 | return 1 |
654 | } |
655 | # String => '\\x[0-9A-Fa-f]{1,2}' |
656 | # attribute => 'Escape Code' |
657 | # context => '#stay' |
658 | # type => 'RegExpr' |
659 | if ($self->testRegExpr($text, '\\\\x[0-9A-Fa-f]{1,2}', 0, 0, 0, undef, 0, '#stay', 'Escape Code')) { |
660 | return 1 |
661 | } |
662 | # attribute => 'String' |
663 | # char => '"' |
664 | # context => '#pop' |
665 | # type => 'DetectChar' |
666 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { |
667 | return 1 |
668 | } |
669 | return 0; |
670 | }; |
671 | |
672 | sub parsehtmlcomment { |
673 | my ($self, $text) = @_; |
674 | # String => '<%' |
675 | # attribute => 'Keyword' |
676 | # context => 'aspsource' |
677 | # type => 'StringDetect' |
678 | if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) { |
679 | return 1 |
680 | } |
681 | # String => '<%' |
682 | # attribute => 'Keyword' |
683 | # context => 'aspsource' |
684 | # type => 'StringDetect' |
685 | if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) { |
686 | return 1 |
687 | } |
688 | # String => '-->' |
689 | # attribute => 'HTML Comment' |
690 | # context => '#pop' |
691 | # type => 'StringDetect' |
692 | if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'HTML Comment')) { |
693 | return 1 |
694 | } |
695 | # String => '\s*=\s*' |
696 | # attribute => 'Normal Text' |
697 | # context => 'identifiers' |
698 | # type => 'RegExpr' |
699 | if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'identifiers', 'Normal Text')) { |
700 | return 1 |
701 | } |
702 | return 0; |
703 | }; |
704 | |
705 | sub parsehtmltag { |
706 | my ($self, $text) = @_; |
707 | # attribute => 'HTML Tag' |
708 | # char => '/' |
709 | # char1 => '>' |
710 | # context => '#pop' |
711 | # type => 'Detect2Chars' |
712 | if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop', 'HTML Tag')) { |
713 | return 1 |
714 | } |
715 | # attribute => 'HTML Tag' |
716 | # char => '>' |
717 | # context => '#pop' |
718 | # type => 'DetectChar' |
719 | if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'HTML Tag')) { |
720 | return 1 |
721 | } |
722 | # String => '<%' |
723 | # attribute => 'Keyword' |
724 | # context => 'aspsource' |
725 | # type => 'StringDetect' |
726 | if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) { |
727 | return 1 |
728 | } |
729 | # String => '<%' |
730 | # attribute => 'Keyword' |
731 | # context => 'aspsource' |
732 | # type => 'StringDetect' |
733 | if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) { |
734 | return 1 |
735 | } |
736 | # String => '\s*=\s*' |
737 | # attribute => 'Identifier' |
738 | # context => 'identifiers' |
739 | # type => 'RegExpr' |
740 | if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'identifiers', 'Identifier')) { |
741 | return 1 |
742 | } |
743 | return 0; |
744 | }; |
745 | |
746 | sub parseidentifiers { |
747 | my ($self, $text) = @_; |
748 | # String => '\s*#?[a-zA-Z0-9]*' |
749 | # attribute => 'String' |
750 | # context => '#pop' |
751 | # type => 'RegExpr' |
752 | if ($self->testRegExpr($text, '\\s*#?[a-zA-Z0-9]*', 0, 0, 0, undef, 0, '#pop', 'String')) { |
753 | return 1 |
754 | } |
755 | # attribute => 'Types' |
756 | # char => ''' |
757 | # context => 'types1' |
758 | # type => 'DetectChar' |
759 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'types1', 'Types')) { |
760 | return 1 |
761 | } |
762 | # attribute => 'Types' |
763 | # char => '"' |
764 | # context => 'types2' |
765 | # type => 'DetectChar' |
766 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'types2', 'Types')) { |
767 | return 1 |
768 | } |
769 | return 0; |
770 | }; |
771 | |
772 | sub parsenosource { |
773 | my ($self, $text) = @_; |
774 | # String => '<%' |
775 | # attribute => 'Keyword' |
776 | # context => 'aspsource' |
777 | # type => 'StringDetect' |
778 | if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) { |
779 | return 1 |
780 | } |
781 | # String => '<\s*script(\s|>)' |
782 | # attribute => 'HTML Tag' |
783 | # context => 'scripts' |
784 | # insensitive => 'TRUE' |
785 | # type => 'RegExpr' |
786 | if ($self->testRegExpr($text, '<\\s*script(\\s|>)', 1, 0, 0, undef, 0, 'scripts', 'HTML Tag')) { |
787 | return 1 |
788 | } |
789 | # String => '<\s*\/?\s*[a-zA-Z_:][a-zA-Z0-9._:-]*' |
790 | # attribute => 'HTML Tag' |
791 | # context => 'htmltag' |
792 | # type => 'RegExpr' |
793 | if ($self->testRegExpr($text, '<\\s*\\/?\\s*[a-zA-Z_:][a-zA-Z0-9._:-]*', 0, 0, 0, undef, 0, 'htmltag', 'HTML Tag')) { |
794 | return 1 |
795 | } |
796 | # String => '<!--' |
797 | # attribute => 'HTML Comment' |
798 | # context => 'htmlcomment' |
799 | # type => 'StringDetect' |
800 | if ($self->testStringDetect($text, '<!--', 0, 0, 0, undef, 0, 'htmlcomment', 'HTML Comment')) { |
801 | return 1 |
802 | } |
803 | return 0; |
804 | }; |
805 | |
806 | sub parsescripts { |
807 | my ($self, $text) = @_; |
808 | # attribute => 'Comment' |
809 | # char => '/' |
810 | # char1 => '/' |
811 | # context => 'scripts_onelinecomment' |
812 | # type => 'Detect2Chars' |
813 | if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'scripts_onelinecomment', 'Comment')) { |
814 | return 1 |
815 | } |
816 | # attribute => 'Comment' |
817 | # char => '/' |
818 | # char1 => '*' |
819 | # context => 'twolinecomment' |
820 | # type => 'Detect2Chars' |
821 | if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'twolinecomment', 'Comment')) { |
822 | return 1 |
823 | } |
824 | # String => 'control structures' |
825 | # attribute => 'Control Structures' |
826 | # context => '#stay' |
827 | # type => 'keyword' |
828 | if ($self->testKeyword($text, 'control structures', 0, undef, 0, '#stay', 'Control Structures')) { |
829 | return 1 |
830 | } |
831 | # String => 'keywords' |
832 | # attribute => 'Keyword' |
833 | # context => '#stay' |
834 | # type => 'keyword' |
835 | if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { |
836 | return 1 |
837 | } |
838 | # String => 'functions' |
839 | # attribute => 'Function' |
840 | # context => '#stay' |
841 | # type => 'keyword' |
842 | if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) { |
843 | return 1 |
844 | } |
845 | # String => '<%' |
846 | # attribute => 'Keyword' |
847 | # context => 'aspsource' |
848 | # type => 'StringDetect' |
849 | if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) { |
850 | return 1 |
851 | } |
852 | # String => '<\s*\/\s*script\s*>' |
853 | # attribute => 'HTML Tag' |
854 | # context => '#pop' |
855 | # insensitive => 'TRUE' |
856 | # type => 'RegExpr' |
857 | if ($self->testRegExpr($text, '<\\s*\\/\\s*script\\s*>', 1, 0, 0, undef, 0, '#pop', 'HTML Tag')) { |
858 | return 1 |
859 | } |
860 | # attribute => 'String' |
861 | # char => '"' |
862 | # context => 'doublequotestring' |
863 | # type => 'DetectChar' |
864 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'doublequotestring', 'String')) { |
865 | return 1 |
866 | } |
867 | # attribute => 'String' |
868 | # char => ''' |
869 | # context => 'singlequotestring' |
870 | # type => 'DetectChar' |
871 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'singlequotestring', 'String')) { |
872 | return 1 |
873 | } |
874 | # attribute => 'Octal' |
875 | # context => '#stay' |
876 | # type => 'HlCOct' |
877 | if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { |
878 | return 1 |
879 | } |
880 | # attribute => 'Hex' |
881 | # context => '#stay' |
882 | # type => 'HlCHex' |
883 | if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { |
884 | return 1 |
885 | } |
886 | # attribute => 'Float' |
887 | # context => '#stay' |
888 | # type => 'Float' |
889 | if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { |
890 | return 1 |
891 | } |
892 | # attribute => 'Decimal' |
893 | # context => '#stay' |
894 | # type => 'Int' |
895 | if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { |
896 | return 1 |
897 | } |
898 | # attribute => 'Normal Text' |
899 | # beginRegion => 'Brace1' |
900 | # char => '{' |
901 | # context => '#stay' |
902 | # type => 'DetectChar' |
903 | if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
904 | return 1 |
905 | } |
906 | # attribute => 'Normal Text' |
907 | # char => '}' |
908 | # context => '#stay' |
909 | # endRegion => 'Brace1' |
910 | # type => 'DetectChar' |
911 | if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
912 | return 1 |
913 | } |
914 | # String => ';()}{:,[]' |
915 | # attribute => 'Other' |
916 | # context => '#stay' |
917 | # type => 'AnyChar' |
918 | if ($self->testAnyChar($text, ';()}{:,[]', 0, 0, undef, 0, '#stay', 'Other')) { |
919 | return 1 |
920 | } |
921 | return 0; |
922 | }; |
923 | |
924 | sub parsescripts_onelinecomment { |
925 | my ($self, $text) = @_; |
926 | # String => '<\s*\/\s*script\s*>' |
927 | # attribute => 'HTML Tag' |
928 | # context => '#pop#pop' |
929 | # insensitive => 'TRUE' |
930 | # type => 'RegExpr' |
931 | if ($self->testRegExpr($text, '<\\s*\\/\\s*script\\s*>', 1, 0, 0, undef, 0, '#pop#pop', 'HTML Tag')) { |
932 | return 1 |
933 | } |
934 | return 0; |
935 | }; |
936 | |
937 | sub parsesinglequotestring { |
938 | my ($self, $text) = @_; |
939 | # attribute => 'Escape Code' |
940 | # char => ''' |
941 | # char1 => ''' |
942 | # context => '#stay' |
943 | # type => 'Detect2Chars' |
944 | if ($self->testDetect2Chars($text, '\'', '\'', 0, 0, 0, undef, 0, '#stay', 'Escape Code')) { |
945 | return 1 |
946 | } |
947 | # attribute => 'String' |
948 | # char => ''' |
949 | # context => '#pop' |
950 | # type => 'DetectChar' |
951 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { |
952 | return 1 |
953 | } |
954 | return 0; |
955 | }; |
956 | |
957 | sub parsetwolinecomment { |
958 | my ($self, $text) = @_; |
959 | # attribute => 'Comment' |
960 | # char => '*' |
961 | # char1 => '/' |
962 | # context => '#pop' |
963 | # endRegion => 'Comment' |
964 | # type => 'Detect2Chars' |
965 | if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { |
966 | return 1 |
967 | } |
968 | return 0; |
969 | }; |
970 | |
971 | sub parsetypes1 { |
972 | my ($self, $text) = @_; |
973 | # String => '<%' |
974 | # attribute => 'Keyword' |
975 | # context => 'aspsource' |
976 | # type => 'StringDetect' |
977 | if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) { |
978 | return 1 |
979 | } |
980 | # String => '<%' |
981 | # attribute => 'Keyword' |
982 | # context => 'aspsource' |
983 | # type => 'StringDetect' |
984 | if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) { |
985 | return 1 |
986 | } |
987 | # attribute => 'Types' |
988 | # char => ''' |
989 | # context => '#pop#pop' |
990 | # type => 'DetectChar' |
991 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop#pop', 'Types')) { |
992 | return 1 |
993 | } |
994 | return 0; |
995 | }; |
996 | |
997 | sub parsetypes2 { |
998 | my ($self, $text) = @_; |
999 | # String => '<%' |
1000 | # attribute => 'Keyword' |
1001 | # context => 'aspsource' |
1002 | # type => 'StringDetect' |
1003 | if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) { |
1004 | return 1 |
1005 | } |
1006 | # String => '<%' |
1007 | # attribute => 'Keyword' |
1008 | # context => 'aspsource' |
1009 | # type => 'StringDetect' |
1010 | if ($self->testStringDetect($text, '<%', 0, 0, 0, undef, 0, 'aspsource', 'Keyword')) { |
1011 | return 1 |
1012 | } |
1013 | # attribute => 'Types' |
1014 | # char => '"' |
1015 | # context => '#pop#pop' |
1016 | # type => 'DetectChar' |
1017 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop#pop', 'Types')) { |
1018 | return 1 |
1019 | } |
1020 | return 0; |
1021 | }; |
1022 | |
1023 | |
1024 | 1; |
1025 | |
1026 | __END__ |
1027 | |
1028 | =head1 NAME |
1029 | |
1030 | Syntax::Highlight::Engine::Kate::ASP - a Plugin for ASP syntax highlighting |
1031 | |
1032 | =head1 SYNOPSIS |
1033 | |
1034 | require Syntax::Highlight::Engine::Kate::ASP; |
1035 | my $sh = new Syntax::Highlight::Engine::Kate::ASP([ |
1036 | ]); |
1037 | |
1038 | =head1 DESCRIPTION |
1039 | |
1040 | Syntax::Highlight::Engine::Kate::ASP is a plugin module that provides syntax highlighting |
1041 | for ASP to the Syntax::Haghlight::Engine::Kate highlighting engine. |
1042 | |
1043 | This code is generated from the syntax definition files used |
1044 | by the Kate project. |
1045 | It works quite fine, but can use refinement and optimization. |
1046 | |
1047 | It inherits Syntax::Higlight::Engine::Kate::Template. See also there. |
1048 | |
1049 | =cut |
1050 | |
1051 | =head1 AUTHOR |
1052 | |
1053 | Hans Jeuken (haje <at> toneel <dot> demon <dot> nl) |
1054 | |
1055 | =cut |
1056 | |
1057 | =head1 BUGS |
1058 | |
1059 | Unknown. If you find any, please contact the author |
1060 | |
1061 | =cut |
1062 | |