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 'd.xml' file of the syntax highlight |
6 | # engine of the kate text editor (http://www.kate-editor.org |
7 | |
8 | #kate xml version 1.36 |
9 | #kate version 2.2 |
10 | #kate author Simon J Mackenzie (project.katedxml@smackoz.fastmail.fm) |
11 | #generated: Sun Feb 3 22:02:04 2008, localtime |
12 | |
13 | package Syntax::Highlight::Engine::Kate::D; |
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 | 'Assert' => 'Variable', |
27 | 'Binary' => 'BaseN', |
28 | 'Char' => 'Char', |
29 | 'Comment' => 'Comment', |
30 | 'Debug' => 'BaseN', |
31 | 'Escape String' => 'String', |
32 | 'Float' => 'Float', |
33 | 'Hex' => 'BaseN', |
34 | 'Integer' => 'DecVal', |
35 | 'Keyword' => 'Keyword', |
36 | 'Linkage' => 'IString', |
37 | 'Linkage Type' => 'Others', |
38 | 'Module' => 'Keyword', |
39 | 'Module Name' => 'Reserved', |
40 | 'Normal Text' => 'Normal', |
41 | 'Octal' => 'BaseN', |
42 | 'Phobos Library' => 'BString', |
43 | 'Pragma' => 'Keyword', |
44 | 'String' => 'String', |
45 | 'Type' => 'DataType', |
46 | 'Unit Test' => 'RegionMarker', |
47 | 'Version' => 'Keyword', |
48 | 'Version Type' => 'DataType', |
49 | 'Wysiwyg' => 'Char', |
50 | }); |
51 | $self->listAdd('assert', |
52 | 'assert', |
53 | ); |
54 | $self->listAdd('debug', |
55 | 'debug', |
56 | ); |
57 | $self->listAdd('keywords', |
58 | 'abstract', |
59 | 'alias', |
60 | 'align', |
61 | 'asm', |
62 | 'auto', |
63 | 'body', |
64 | 'break', |
65 | 'case', |
66 | 'cast', |
67 | 'catch', |
68 | 'class', |
69 | 'const', |
70 | 'continue', |
71 | 'default', |
72 | 'delegate', |
73 | 'delete', |
74 | 'deprecated', |
75 | 'do', |
76 | 'else', |
77 | 'enum', |
78 | 'export', |
79 | 'false', |
80 | 'final', |
81 | 'finally', |
82 | 'for', |
83 | 'foreach', |
84 | 'function', |
85 | 'goto', |
86 | 'if', |
87 | 'in', |
88 | 'inout', |
89 | 'interface', |
90 | 'invariant', |
91 | 'is', |
92 | 'mixin', |
93 | 'new', |
94 | 'null', |
95 | 'out', |
96 | 'override', |
97 | 'package', |
98 | 'private', |
99 | 'protected', |
100 | 'public', |
101 | 'return', |
102 | 'static', |
103 | 'struct', |
104 | 'super', |
105 | 'switch', |
106 | 'synchronized', |
107 | 'template', |
108 | 'this', |
109 | 'throw', |
110 | 'true', |
111 | 'try', |
112 | 'typedef', |
113 | 'typeof', |
114 | 'union', |
115 | 'volatile', |
116 | 'while', |
117 | 'with', |
118 | ); |
119 | $self->listAdd('linkage', |
120 | 'extern', |
121 | ); |
122 | $self->listAdd('ltypes', |
123 | 'C', |
124 | 'D', |
125 | 'Pascal', |
126 | 'Windows', |
127 | ); |
128 | $self->listAdd('modules', |
129 | 'import', |
130 | 'module', |
131 | ); |
132 | $self->listAdd('phobos', |
133 | 'printf', |
134 | 'writef', |
135 | ); |
136 | $self->listAdd('pragma', |
137 | 'pragma', |
138 | ); |
139 | $self->listAdd('ptypes', |
140 | 'msg', |
141 | ); |
142 | $self->listAdd('types', |
143 | 'bit', |
144 | 'byte', |
145 | 'cdouble', |
146 | 'cent', |
147 | 'cfloat', |
148 | 'char', |
149 | 'creal', |
150 | 'dchar', |
151 | 'double', |
152 | 'float', |
153 | 'idouble', |
154 | 'ifloat', |
155 | 'int', |
156 | 'ireal', |
157 | 'long', |
158 | 'real', |
159 | 'short', |
160 | 'ubyte', |
161 | 'ucent', |
162 | 'uint', |
163 | 'ulong', |
164 | 'ushort', |
165 | 'void', |
166 | 'wchar', |
167 | ); |
168 | $self->listAdd('unittest', |
169 | 'unittest', |
170 | ); |
171 | $self->listAdd('version', |
172 | 'version', |
173 | ); |
174 | $self->listAdd('vtypes', |
175 | 'AMD64', |
176 | 'BigEndian', |
177 | 'D_InlineAsm', |
178 | 'DigitalMars', |
179 | 'LittleEndian', |
180 | 'Win32', |
181 | 'Win64', |
182 | 'Windows', |
183 | 'X86', |
184 | 'linux', |
185 | 'none', |
186 | ); |
187 | $self->contextdata({ |
188 | 'Char' => { |
189 | callback => \&parseChar, |
190 | attribute => 'Char', |
191 | }, |
192 | 'CommentBlockA' => { |
193 | callback => \&parseCommentBlockA, |
194 | attribute => 'Comment', |
195 | }, |
196 | 'CommentBlockB' => { |
197 | callback => \&parseCommentBlockB, |
198 | attribute => 'Comment', |
199 | }, |
200 | 'CommentLine' => { |
201 | callback => \&parseCommentLine, |
202 | attribute => 'Comment', |
203 | lineending => '#pop', |
204 | }, |
205 | 'Hex' => { |
206 | callback => \&parseHex, |
207 | attribute => 'Hex', |
208 | }, |
209 | 'Linkage' => { |
210 | callback => \&parseLinkage, |
211 | attribute => 'Linkage', |
212 | lineending => '#pop', |
213 | }, |
214 | 'ModuleName' => { |
215 | callback => \&parseModuleName, |
216 | attribute => 'Module Name', |
217 | }, |
218 | 'Pragmas' => { |
219 | callback => \&parsePragmas, |
220 | attribute => 'Pragma', |
221 | lineending => '#pop', |
222 | }, |
223 | 'String' => { |
224 | callback => \&parseString, |
225 | attribute => 'String', |
226 | }, |
227 | 'Version' => { |
228 | callback => \&parseVersion, |
229 | attribute => 'Version', |
230 | lineending => '#pop', |
231 | }, |
232 | 'Wysiwyg' => { |
233 | callback => \&parseWysiwyg, |
234 | attribute => 'Wysiwyg', |
235 | }, |
236 | 'normal' => { |
237 | callback => \&parsenormal, |
238 | attribute => 'Normal Text', |
239 | }, |
240 | }); |
241 | $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
242 | $self->basecontext('normal'); |
243 | $self->keywordscase(1); |
244 | $self->initialize; |
245 | bless ($self, $class); |
246 | return $self; |
247 | } |
248 | |
249 | sub language { |
250 | return 'D'; |
251 | } |
252 | |
253 | sub parseChar { |
254 | my ($self, $text) = @_; |
255 | # attribute => 'Char' |
256 | # char => '\' |
257 | # char1 => ''' |
258 | # context => '#stay' |
259 | # type => 'Detect2Chars' |
260 | if ($self->testDetect2Chars($text, '\\', '\'', 0, 0, 0, undef, 0, '#stay', 'Char')) { |
261 | return 1 |
262 | } |
263 | # attribute => 'Char' |
264 | # char => '\' |
265 | # char1 => '\' |
266 | # context => '#stay' |
267 | # type => 'Detect2Chars' |
268 | if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'Char')) { |
269 | return 1 |
270 | } |
271 | # attribute => 'Char' |
272 | # char => ''' |
273 | # context => '#pop' |
274 | # type => 'DetectChar' |
275 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Char')) { |
276 | return 1 |
277 | } |
278 | return 0; |
279 | }; |
280 | |
281 | sub parseCommentBlockA { |
282 | my ($self, $text) = @_; |
283 | # attribute => 'Comment' |
284 | # char => '*' |
285 | # char1 => '/' |
286 | # context => '#pop' |
287 | # endRegion => 'CommentA' |
288 | # type => 'Detect2Chars' |
289 | if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { |
290 | return 1 |
291 | } |
292 | return 0; |
293 | }; |
294 | |
295 | sub parseCommentBlockB { |
296 | my ($self, $text) = @_; |
297 | # attribute => 'Comment' |
298 | # char => '+' |
299 | # char1 => '/' |
300 | # context => '#pop' |
301 | # endRegion => 'CommentB' |
302 | # type => 'Detect2Chars' |
303 | if ($self->testDetect2Chars($text, '+', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { |
304 | return 1 |
305 | } |
306 | return 0; |
307 | }; |
308 | |
309 | sub parseCommentLine { |
310 | my ($self, $text) = @_; |
311 | return 0; |
312 | }; |
313 | |
314 | sub parseHex { |
315 | my ($self, $text) = @_; |
316 | # attribute => 'Hex' |
317 | # char => '"' |
318 | # context => '#pop' |
319 | # type => 'DetectChar' |
320 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Hex')) { |
321 | return 1 |
322 | } |
323 | return 0; |
324 | }; |
325 | |
326 | sub parseLinkage { |
327 | my ($self, $text) = @_; |
328 | # String => 'types' |
329 | # attribute => 'Type' |
330 | # context => '#pop' |
331 | # type => 'keyword' |
332 | if ($self->testKeyword($text, 'types', 0, undef, 0, '#pop', 'Type')) { |
333 | return 1 |
334 | } |
335 | # attribute => 'Normal Text' |
336 | # char => '(' |
337 | # context => '#stay' |
338 | # type => 'DetectChar' |
339 | if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
340 | return 1 |
341 | } |
342 | # String => 'ltypes' |
343 | # attribute => 'Linkage Type' |
344 | # context => '#stay' |
345 | # type => 'keyword' |
346 | if ($self->testKeyword($text, 'ltypes', 0, undef, 0, '#stay', 'Linkage Type')) { |
347 | return 1 |
348 | } |
349 | # attribute => 'Normal Text' |
350 | # char => ')' |
351 | # context => '#pop' |
352 | # type => 'DetectChar' |
353 | if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
354 | return 1 |
355 | } |
356 | # attribute => 'Normal Text' |
357 | # char => ';' |
358 | # context => '#pop' |
359 | # type => 'DetectChar' |
360 | if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
361 | return 1 |
362 | } |
363 | return 0; |
364 | }; |
365 | |
366 | sub parseModuleName { |
367 | my ($self, $text) = @_; |
368 | # attribute => 'Normal Text' |
369 | # char => ',' |
370 | # context => '#stay' |
371 | # type => 'DetectChar' |
372 | if ($self->testDetectChar($text, ',', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
373 | return 1 |
374 | } |
375 | # attribute => 'Normal Text' |
376 | # char => ';' |
377 | # context => '#pop' |
378 | # type => 'DetectChar' |
379 | if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
380 | return 1 |
381 | } |
382 | # attribute => 'Comment' |
383 | # char => '/' |
384 | # char1 => '/' |
385 | # context => 'CommentLine' |
386 | # type => 'Detect2Chars' |
387 | if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'CommentLine', 'Comment')) { |
388 | return 1 |
389 | } |
390 | # attribute => 'Comment' |
391 | # beginRegion => 'CommentA' |
392 | # char => '/' |
393 | # char1 => '*' |
394 | # context => 'CommentBlockA' |
395 | # type => 'Detect2Chars' |
396 | if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'CommentBlockA', 'Comment')) { |
397 | return 1 |
398 | } |
399 | # attribute => 'Comment' |
400 | # beginRegion => 'CommentB' |
401 | # char => '/' |
402 | # char1 => '+' |
403 | # context => 'CommentBlockB' |
404 | # type => 'Detect2Chars' |
405 | if ($self->testDetect2Chars($text, '/', '+', 0, 0, 0, undef, 0, 'CommentBlockB', 'Comment')) { |
406 | return 1 |
407 | } |
408 | return 0; |
409 | }; |
410 | |
411 | sub parsePragmas { |
412 | my ($self, $text) = @_; |
413 | # attribute => 'Normal Text' |
414 | # char => '(' |
415 | # context => '#stay' |
416 | # type => 'DetectChar' |
417 | if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
418 | return 1 |
419 | } |
420 | # String => 'ptypes' |
421 | # attribute => 'Version Type' |
422 | # context => '#stay' |
423 | # type => 'keyword' |
424 | if ($self->testKeyword($text, 'ptypes', 0, undef, 0, '#stay', 'Version Type')) { |
425 | return 1 |
426 | } |
427 | # String => 'vtypes' |
428 | # attribute => 'Version Type' |
429 | # context => '#stay' |
430 | # type => 'keyword' |
431 | if ($self->testKeyword($text, 'vtypes', 0, undef, 0, '#stay', 'Version Type')) { |
432 | return 1 |
433 | } |
434 | # String => '[_a-z][\w]*' |
435 | # attribute => 'Keyword' |
436 | # context => '#pop' |
437 | # insensitive => 'true' |
438 | # type => 'RegExpr' |
439 | if ($self->testRegExpr($text, '[_a-z][\\w]*', 1, 0, 0, undef, 0, '#pop', 'Keyword')) { |
440 | return 1 |
441 | } |
442 | # attribute => 'Normal Text' |
443 | # char => ',' |
444 | # context => '#pop' |
445 | # type => 'DetectChar' |
446 | if ($self->testDetectChar($text, ',', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
447 | return 1 |
448 | } |
449 | # attribute => 'Normal Text' |
450 | # char => ')' |
451 | # context => '#pop' |
452 | # type => 'DetectChar' |
453 | if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
454 | return 1 |
455 | } |
456 | return 0; |
457 | }; |
458 | |
459 | sub parseString { |
460 | my ($self, $text) = @_; |
461 | # attribute => 'String' |
462 | # char => '"' |
463 | # context => '#pop' |
464 | # type => 'DetectChar' |
465 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { |
466 | return 1 |
467 | } |
468 | return 0; |
469 | }; |
470 | |
471 | sub parseVersion { |
472 | my ($self, $text) = @_; |
473 | # attribute => 'Normal Text' |
474 | # char => '=' |
475 | # context => '#pop' |
476 | # type => 'DetectChar' |
477 | if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
478 | return 1 |
479 | } |
480 | # attribute => 'Normal Text' |
481 | # char => '(' |
482 | # context => '#stay' |
483 | # type => 'DetectChar' |
484 | if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
485 | return 1 |
486 | } |
487 | # String => 'vtypes' |
488 | # attribute => 'Version Type' |
489 | # context => '#stay' |
490 | # type => 'keyword' |
491 | if ($self->testKeyword($text, 'vtypes', 0, undef, 0, '#stay', 'Version Type')) { |
492 | return 1 |
493 | } |
494 | # String => '\w' |
495 | # attribute => 'Normal Text' |
496 | # context => '#pop' |
497 | # insensitive => 'true' |
498 | # type => 'RegExpr' |
499 | if ($self->testRegExpr($text, '\\w', 1, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
500 | return 1 |
501 | } |
502 | # attribute => 'Normal Text' |
503 | # char => ')' |
504 | # context => '#pop' |
505 | # type => 'DetectChar' |
506 | if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
507 | return 1 |
508 | } |
509 | return 0; |
510 | }; |
511 | |
512 | sub parseWysiwyg { |
513 | my ($self, $text) = @_; |
514 | # attribute => 'Wysiwyg' |
515 | # char => '"' |
516 | # context => '#pop' |
517 | # type => 'DetectChar' |
518 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Wysiwyg')) { |
519 | return 1 |
520 | } |
521 | # attribute => 'Wysiwyg' |
522 | # char => '`' |
523 | # context => '#pop' |
524 | # type => 'DetectChar' |
525 | if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, '#pop', 'Wysiwyg')) { |
526 | return 1 |
527 | } |
528 | return 0; |
529 | }; |
530 | |
531 | sub parsenormal { |
532 | my ($self, $text) = @_; |
533 | # String => 'keywords' |
534 | # attribute => 'Keyword' |
535 | # context => '#stay' |
536 | # type => 'keyword' |
537 | if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { |
538 | return 1 |
539 | } |
540 | # String => 'modules' |
541 | # attribute => 'Module' |
542 | # context => 'ModuleName' |
543 | # type => 'keyword' |
544 | if ($self->testKeyword($text, 'modules', 0, undef, 0, 'ModuleName', 'Module')) { |
545 | return 1 |
546 | } |
547 | # String => 'types' |
548 | # attribute => 'Type' |
549 | # context => '#stay' |
550 | # type => 'keyword' |
551 | if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Type')) { |
552 | return 1 |
553 | } |
554 | # String => 'phobos' |
555 | # attribute => 'Phobos Library' |
556 | # context => '#stay' |
557 | # type => 'keyword' |
558 | if ($self->testKeyword($text, 'phobos', 0, undef, 0, '#stay', 'Phobos Library')) { |
559 | return 1 |
560 | } |
561 | # String => 'linkage' |
562 | # attribute => 'Linkage' |
563 | # context => 'Linkage' |
564 | # type => 'keyword' |
565 | if ($self->testKeyword($text, 'linkage', 0, undef, 0, 'Linkage', 'Linkage')) { |
566 | return 1 |
567 | } |
568 | # String => 'debug' |
569 | # attribute => 'Debug' |
570 | # context => '#stay' |
571 | # type => 'keyword' |
572 | if ($self->testKeyword($text, 'debug', 0, undef, 0, '#stay', 'Debug')) { |
573 | return 1 |
574 | } |
575 | # String => 'assert' |
576 | # attribute => 'Assert' |
577 | # context => '#stay' |
578 | # type => 'keyword' |
579 | if ($self->testKeyword($text, 'assert', 0, undef, 0, '#stay', 'Assert')) { |
580 | return 1 |
581 | } |
582 | # String => 'pragma' |
583 | # attribute => 'Pragma' |
584 | # context => 'Pragmas' |
585 | # type => 'keyword' |
586 | if ($self->testKeyword($text, 'pragma', 0, undef, 0, 'Pragmas', 'Pragma')) { |
587 | return 1 |
588 | } |
589 | # String => 'version' |
590 | # attribute => 'Version' |
591 | # context => 'Version' |
592 | # type => 'keyword' |
593 | if ($self->testKeyword($text, 'version', 0, undef, 0, 'Version', 'Version')) { |
594 | return 1 |
595 | } |
596 | # String => 'unittest' |
597 | # attribute => 'Unit Test' |
598 | # context => '#stay' |
599 | # type => 'keyword' |
600 | if ($self->testKeyword($text, 'unittest', 0, undef, 0, '#stay', 'Unit Test')) { |
601 | return 1 |
602 | } |
603 | # attribute => 'Wysiwyg' |
604 | # char => 'r' |
605 | # char1 => '"' |
606 | # context => 'Wysiwyg' |
607 | # type => 'Detect2Chars' |
608 | if ($self->testDetect2Chars($text, 'r', '"', 0, 0, 0, undef, 0, 'Wysiwyg', 'Wysiwyg')) { |
609 | return 1 |
610 | } |
611 | # attribute => 'Hex' |
612 | # char => 'x' |
613 | # char1 => '"' |
614 | # context => 'Hex' |
615 | # type => 'Detect2Chars' |
616 | if ($self->testDetect2Chars($text, 'x', '"', 0, 0, 0, undef, 0, 'Hex', 'Hex')) { |
617 | return 1 |
618 | } |
619 | # String => '[_a-z][\w]*' |
620 | # attribute => 'Normal Text' |
621 | # context => '#pop' |
622 | # insensitive => 'true' |
623 | # type => 'RegExpr' |
624 | if ($self->testRegExpr($text, '[_a-z][\\w]*', 1, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
625 | return 1 |
626 | } |
627 | # String => '\#[ ]*line' |
628 | # attribute => 'Pragma' |
629 | # context => '#pop' |
630 | # type => 'RegExpr' |
631 | if ($self->testRegExpr($text, '\\#[ ]*line', 0, 0, 0, undef, 0, '#pop', 'Pragma')) { |
632 | return 1 |
633 | } |
634 | # String => '\\[n|t|"]' |
635 | # attribute => 'Escape String' |
636 | # context => '#pop' |
637 | # type => 'RegExpr' |
638 | if ($self->testRegExpr($text, '\\\\[n|t|"]', 0, 0, 0, undef, 0, '#pop', 'Escape String')) { |
639 | return 1 |
640 | } |
641 | # String => '(\\r\\n)' |
642 | # attribute => 'Escape String' |
643 | # context => '#pop' |
644 | # type => 'RegExpr' |
645 | if ($self->testRegExpr($text, '(\\\\r\\\\n)', 0, 0, 0, undef, 0, '#pop', 'Escape String')) { |
646 | return 1 |
647 | } |
648 | # String => '\\0[0-7]+' |
649 | # attribute => 'Escape String' |
650 | # context => '#pop' |
651 | # type => 'RegExpr' |
652 | if ($self->testRegExpr($text, '\\\\0[0-7]+', 0, 0, 0, undef, 0, '#pop', 'Escape String')) { |
653 | return 1 |
654 | } |
655 | # String => '\\u[\d]+' |
656 | # attribute => 'Escape String' |
657 | # context => '#pop' |
658 | # insensitive => 'true' |
659 | # type => 'RegExpr' |
660 | if ($self->testRegExpr($text, '\\\\u[\\d]+', 1, 0, 0, undef, 0, '#pop', 'Escape String')) { |
661 | return 1 |
662 | } |
663 | # String => '\\x[\da-fA-F]+' |
664 | # attribute => 'Escape String' |
665 | # context => '#pop' |
666 | # type => 'RegExpr' |
667 | if ($self->testRegExpr($text, '\\\\x[\\da-fA-F]+', 0, 0, 0, undef, 0, '#pop', 'Escape String')) { |
668 | return 1 |
669 | } |
670 | # String => '0b[01]+[_01]*[ ]*\.\.[ ]*0b[01]+[_01]*(UL|LU|U|L)?' |
671 | # attribute => 'Binary' |
672 | # context => '#pop' |
673 | # insensitive => 'true' |
674 | # type => 'RegExpr' |
675 | if ($self->testRegExpr($text, '0b[01]+[_01]*[ ]*\\.\\.[ ]*0b[01]+[_01]*(UL|LU|U|L)?', 1, 0, 0, undef, 0, '#pop', 'Binary')) { |
676 | return 1 |
677 | } |
678 | # String => '0[0-7]+[_0-7]*[ ]*\.\.[ ]*0[0-7]+[_0-7]*(UL|LU|U|L)?' |
679 | # attribute => 'Octal' |
680 | # context => '#pop' |
681 | # insensitive => 'true' |
682 | # type => 'RegExpr' |
683 | if ($self->testRegExpr($text, '0[0-7]+[_0-7]*[ ]*\\.\\.[ ]*0[0-7]+[_0-7]*(UL|LU|U|L)?', 1, 0, 0, undef, 0, '#pop', 'Octal')) { |
684 | return 1 |
685 | } |
686 | # String => '0x[\da-f]+[_\da-f]*[ ]*\.\.[ ]*0x[\da-f]+[_\da-f]*(UL|LU|U|L)?' |
687 | # attribute => 'Hex' |
688 | # context => '#pop' |
689 | # insensitive => 'true' |
690 | # type => 'RegExpr' |
691 | if ($self->testRegExpr($text, '0x[\\da-f]+[_\\da-f]*[ ]*\\.\\.[ ]*0x[\\da-f]+[_\\da-f]*(UL|LU|U|L)?', 1, 0, 0, undef, 0, '#pop', 'Hex')) { |
692 | return 1 |
693 | } |
694 | # String => '[\d]+[_\d]*(UL|LU|U|L)?[ ]*\.\.[ ]*[\d]+[_\d]*(UL|LU|U|L)?' |
695 | # attribute => 'Integer' |
696 | # context => '#pop' |
697 | # insensitive => 'true' |
698 | # type => 'RegExpr' |
699 | if ($self->testRegExpr($text, '[\\d]+[_\\d]*(UL|LU|U|L)?[ ]*\\.\\.[ ]*[\\d]+[_\\d]*(UL|LU|U|L)?', 1, 0, 0, undef, 0, '#pop', 'Integer')) { |
700 | return 1 |
701 | } |
702 | # String => '[\d]*[_\d]*\.[_\d]*(e-|e|e\+)?[\d]+[_\d]*(F|L|I|FI|LI|)?' |
703 | # attribute => 'Float' |
704 | # context => '#pop' |
705 | # insensitive => 'true' |
706 | # type => 'RegExpr' |
707 | if ($self->testRegExpr($text, '[\\d]*[_\\d]*\\.[_\\d]*(e-|e|e\\+)?[\\d]+[_\\d]*(F|L|I|FI|LI|)?', 1, 0, 0, undef, 0, '#pop', 'Float')) { |
708 | return 1 |
709 | } |
710 | # String => '[\d]*[_\d]*\.?[_\d]*(e-|e|e\+)[\d]+[_\d]*(F|L|I|FI|LI|)?' |
711 | # attribute => 'Float' |
712 | # context => '#pop' |
713 | # insensitive => 'true' |
714 | # type => 'RegExpr' |
715 | if ($self->testRegExpr($text, '[\\d]*[_\\d]*\\.?[_\\d]*(e-|e|e\\+)[\\d]+[_\\d]*(F|L|I|FI|LI|)?', 1, 0, 0, undef, 0, '#pop', 'Float')) { |
716 | return 1 |
717 | } |
718 | # String => '0x[\da-f]+[_\da-f]*\.[_\da-f]*(p-|p|p\+)?[\da-f]+[_\da-f]*(F|L|I|FI|LI)?' |
719 | # attribute => 'Float' |
720 | # context => '#pop' |
721 | # insensitive => 'true' |
722 | # type => 'RegExpr' |
723 | if ($self->testRegExpr($text, '0x[\\da-f]+[_\\da-f]*\\.[_\\da-f]*(p-|p|p\\+)?[\\da-f]+[_\\da-f]*(F|L|I|FI|LI)?', 1, 0, 0, undef, 0, '#pop', 'Float')) { |
724 | return 1 |
725 | } |
726 | # String => '0x[\da-f]+[_\da-f]*\.?[_\da-f]*(p-|p|p\+)[\da-f]+[_\da-f]*(F|L|I|FI|LI)?' |
727 | # attribute => 'Float' |
728 | # context => '#pop' |
729 | # insensitive => 'true' |
730 | # type => 'RegExpr' |
731 | if ($self->testRegExpr($text, '0x[\\da-f]+[_\\da-f]*\\.?[_\\da-f]*(p-|p|p\\+)[\\da-f]+[_\\da-f]*(F|L|I|FI|LI)?', 1, 0, 0, undef, 0, '#pop', 'Float')) { |
732 | return 1 |
733 | } |
734 | # String => '0B[01]+[_01]*(UL|LU|U|L)?' |
735 | # attribute => 'Binary' |
736 | # context => '#pop' |
737 | # insensitive => 'true' |
738 | # type => 'RegExpr' |
739 | if ($self->testRegExpr($text, '0B[01]+[_01]*(UL|LU|U|L)?', 1, 0, 0, undef, 0, '#pop', 'Binary')) { |
740 | return 1 |
741 | } |
742 | # String => '0[0-7]+[_0-7]*(UL|LU|U|L)?' |
743 | # attribute => 'Octal' |
744 | # context => '#pop' |
745 | # insensitive => 'true' |
746 | # type => 'RegExpr' |
747 | if ($self->testRegExpr($text, '0[0-7]+[_0-7]*(UL|LU|U|L)?', 1, 0, 0, undef, 0, '#pop', 'Octal')) { |
748 | return 1 |
749 | } |
750 | # String => '0x[\da-f]+[_\da-f]*(UL|LU|U|L)?' |
751 | # attribute => 'Hex' |
752 | # context => '#pop' |
753 | # insensitive => 'true' |
754 | # type => 'RegExpr' |
755 | if ($self->testRegExpr($text, '0x[\\da-f]+[_\\da-f]*(UL|LU|U|L)?', 1, 0, 0, undef, 0, '#pop', 'Hex')) { |
756 | return 1 |
757 | } |
758 | # String => '[\d]+[_\d]*(UL|LU|U|L)?' |
759 | # attribute => 'Integer' |
760 | # context => '#pop' |
761 | # insensitive => 'true' |
762 | # type => 'RegExpr' |
763 | if ($self->testRegExpr($text, '[\\d]+[_\\d]*(UL|LU|U|L)?', 1, 0, 0, undef, 0, '#pop', 'Integer')) { |
764 | return 1 |
765 | } |
766 | # attribute => 'Char' |
767 | # char => ''' |
768 | # context => 'Char' |
769 | # type => 'DetectChar' |
770 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'Char', 'Char')) { |
771 | return 1 |
772 | } |
773 | # attribute => 'String' |
774 | # char => '"' |
775 | # context => 'String' |
776 | # type => 'DetectChar' |
777 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { |
778 | return 1 |
779 | } |
780 | # attribute => 'Wysiwyg' |
781 | # char => '`' |
782 | # context => 'Wysiwyg' |
783 | # type => 'DetectChar' |
784 | if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, 'Wysiwyg', 'Wysiwyg')) { |
785 | return 1 |
786 | } |
787 | # attribute => 'Comment' |
788 | # char => '/' |
789 | # char1 => '/' |
790 | # context => 'CommentLine' |
791 | # type => 'Detect2Chars' |
792 | if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'CommentLine', 'Comment')) { |
793 | return 1 |
794 | } |
795 | # attribute => 'Comment' |
796 | # beginRegion => 'CommentA' |
797 | # char => '/' |
798 | # char1 => '*' |
799 | # context => 'CommentBlockA' |
800 | # type => 'Detect2Chars' |
801 | if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'CommentBlockA', 'Comment')) { |
802 | return 1 |
803 | } |
804 | # attribute => 'Comment' |
805 | # beginRegion => 'CommentB' |
806 | # char => '/' |
807 | # char1 => '+' |
808 | # context => 'CommentBlockB' |
809 | # type => 'Detect2Chars' |
810 | if ($self->testDetect2Chars($text, '/', '+', 0, 0, 0, undef, 0, 'CommentBlockB', 'Comment')) { |
811 | return 1 |
812 | } |
813 | # attribute => 'Normal Text' |
814 | # beginRegion => 'BraceA' |
815 | # char => '{' |
816 | # context => '#stay' |
817 | # type => 'DetectChar' |
818 | if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
819 | return 1 |
820 | } |
821 | # attribute => 'Normal Text' |
822 | # char => '}' |
823 | # context => '#stay' |
824 | # endRegion => 'BraceA' |
825 | # type => 'DetectChar' |
826 | if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
827 | return 1 |
828 | } |
829 | return 0; |
830 | }; |
831 | |
832 | |
833 | 1; |
834 | |
835 | __END__ |
836 | |
837 | =head1 NAME |
838 | |
839 | Syntax::Highlight::Engine::Kate::D - a Plugin for D syntax highlighting |
840 | |
841 | =head1 SYNOPSIS |
842 | |
843 | require Syntax::Highlight::Engine::Kate::D; |
844 | my $sh = new Syntax::Highlight::Engine::Kate::D([ |
845 | ]); |
846 | |
847 | =head1 DESCRIPTION |
848 | |
849 | Syntax::Highlight::Engine::Kate::D is a plugin module that provides syntax highlighting |
850 | for D to the Syntax::Haghlight::Engine::Kate highlighting engine. |
851 | |
852 | This code is generated from the syntax definition files used |
853 | by the Kate project. |
854 | It works quite fine, but can use refinement and optimization. |
855 | |
856 | It inherits Syntax::Higlight::Engine::Kate::Template. See also there. |
857 | |
858 | =cut |
859 | |
860 | =head1 AUTHOR |
861 | |
862 | Hans Jeuken (haje <at> toneel <dot> demon <dot> nl) |
863 | |
864 | =cut |
865 | |
866 | =head1 BUGS |
867 | |
868 | Unknown. If you find any, please contact the author |
869 | |
870 | =cut |
871 | |