Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / LaTeX.pm
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 'latex.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 1.14
9 #kate version 2.4
10 #kate author Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)
11 #generated: Sun Feb  3 22:02:05 2008, localtime
12
13 package Syntax::Highlight::Engine::Kate::LaTeX;
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       'Comment' => 'Comment',
27       'Environment' => 'DataType',
28       'Keyword' => 'Keyword',
29       'Keyword Mathmode' => 'Reserved',
30       'Math' => 'Float',
31       'Normal Text' => 'Normal',
32       'Region Marker' => 'RegionMarker',
33       'Structure' => 'String',
34       'Verbatim' => 'BString',
35    });
36    $self->contextdata({
37       'Comment' => {
38          callback => \&parseComment,
39          attribute => 'Comment',
40          lineending => '#pop',
41       },
42       'ContrSeq' => {
43          callback => \&parseContrSeq,
44          attribute => 'Keyword',
45          lineending => '#pop',
46       },
47       'Environment' => {
48          callback => \&parseEnvironment,
49          attribute => 'Environment',
50       },
51       'FindEnvironment' => {
52          callback => \&parseFindEnvironment,
53          attribute => 'Normal Text',
54       },
55       'Label' => {
56          callback => \&parseLabel,
57          attribute => 'Normal Text',
58          lineending => '#pop#pop',
59          fallthrough => '#pop#pop',
60       },
61       'MathContrSeq' => {
62          callback => \&parseMathContrSeq,
63          attribute => 'Keyword Mathmode',
64          lineending => '#pop',
65       },
66       'MathEnv' => {
67          callback => \&parseMathEnv,
68          attribute => 'Environment',
69       },
70       'MathFindEnd' => {
71          callback => \&parseMathFindEnd,
72          attribute => 'Normal Text',
73          lineending => '#pop',
74          fallthrough => '#pop',
75       },
76       'MathMode' => {
77          callback => \&parseMathMode,
78          attribute => 'Math',
79       },
80       'MathModeEnv' => {
81          callback => \&parseMathModeEnv,
82          attribute => 'Math',
83       },
84       'Normal Text' => {
85          callback => \&parseNormalText,
86          attribute => 'Normal Text',
87       },
88       'ToEndOfLine' => {
89          callback => \&parseToEndOfLine,
90          attribute => 'Normal Text',
91          lineending => '#pop',
92       },
93       'Verb' => {
94          callback => \&parseVerb,
95          attribute => 'Verbatim',
96          lineending => '#pop',
97          fallthrough => '#pop',
98       },
99       'VerbFindEnd' => {
100          callback => \&parseVerbFindEnd,
101          attribute => 'Normal Text',
102          lineending => '#pop',
103          fallthrough => '#pop',
104       },
105       'Verbatim' => {
106          callback => \&parseVerbatim,
107          attribute => 'Verbatim',
108       },
109       'VerbatimEnv' => {
110          callback => \&parseVerbatimEnv,
111          attribute => 'Environment',
112       },
113    });
114    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
115    $self->basecontext('Normal Text');
116    $self->keywordscase(1);
117    $self->initialize;
118    bless ($self, $class);
119    return $self;
120 }
121
122 sub language {
123    return 'LaTeX';
124 }
125
126 sub parseComment {
127    my ($self, $text) = @_;
128    return 0;
129 };
130
131 sub parseContrSeq {
132    my ($self, $text) = @_;
133    # String => 'verb*'
134    # attribute => 'Keyword'
135    # context => 'Verb'
136    # type => 'StringDetect'
137    if ($self->testStringDetect($text, 'verb*', 0, 0, 0, undef, 0, 'Verb', 'Keyword')) {
138       return 1
139    }
140    # String => 'verb'
141    # attribute => 'Keyword'
142    # context => 'Verb'
143    # type => 'StringDetect'
144    if ($self->testStringDetect($text, 'verb', 0, 0, 0, undef, 0, 'Verb', 'Keyword')) {
145       return 1
146    }
147    # String => '[a-zA-Z]+'
148    # attribute => 'Keyword'
149    # context => '#pop'
150    # type => 'RegExpr'
151    if ($self->testRegExpr($text, '[a-zA-Z]+', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
152       return 1
153    }
154    # String => '[^a-zA-Z]'
155    # attribute => 'Keyword'
156    # context => '#pop'
157    # type => 'RegExpr'
158    if ($self->testRegExpr($text, '[^a-zA-Z]', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
159       return 1
160    }
161    return 0;
162 };
163
164 sub parseEnvironment {
165    my ($self, $text) = @_;
166    # attribute => 'Normal Text'
167    # char => '}'
168    # context => '#pop#pop'
169    # type => 'DetectChar'
170    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop', 'Normal Text')) {
171       return 1
172    }
173    # attribute => 'Normal Text'
174    # char => ']'
175    # context => '#pop#pop'
176    # type => 'DetectChar'
177    if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop#pop', 'Normal Text')) {
178       return 1
179    }
180    # String => '(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\*?'
181    # attribute => 'Environment'
182    # context => 'VerbatimEnv'
183    # type => 'RegExpr'
184    if ($self->testRegExpr($text, '(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\\*?', 0, 0, 0, undef, 0, 'VerbatimEnv', 'Environment')) {
185       return 1
186    }
187    # String => '(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\*?'
188    # attribute => 'Environment'
189    # context => 'MathEnv'
190    # type => 'RegExpr'
191    if ($self->testRegExpr($text, '(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\*?', 0, 0, 0, undef, 0, 'MathEnv', 'Environment')) {
192       return 1
193    }
194    return 0;
195 };
196
197 sub parseFindEnvironment {
198    my ($self, $text) = @_;
199    # attribute => 'Normal Text'
200    # char => '{'
201    # context => 'Environment'
202    # type => 'DetectChar'
203    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'Environment', 'Normal Text')) {
204       return 1
205    }
206    # String => '\S'
207    # attribute => 'Normal Text'
208    # context => '#pop'
209    # type => 'RegExpr'
210    if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
211       return 1
212    }
213    return 0;
214 };
215
216 sub parseLabel {
217    my ($self, $text) = @_;
218    # String => '\s*\{\s*'
219    # attribute => 'Normal Text'
220    # context => '#stay'
221    # type => 'RegExpr'
222    if ($self->testRegExpr($text, '\\s*\\{\\s*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
223       return 1
224    }
225    # String => '[^\}\{]+'
226    # attribute => 'Environment'
227    # context => '#stay'
228    # type => 'RegExpr'
229    if ($self->testRegExpr($text, '[^\\}\\{]+', 0, 0, 0, undef, 0, '#stay', 'Environment')) {
230       return 1
231    }
232    # String => '\s*\}\s*'
233    # attribute => 'Normal Text'
234    # context => '#pop'
235    # type => 'RegExpr'
236    if ($self->testRegExpr($text, '\\s*\\}\\s*', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
237       return 1
238    }
239    return 0;
240 };
241
242 sub parseMathContrSeq {
243    my ($self, $text) = @_;
244    # String => '[a-zA-Z]+'
245    # attribute => 'Keyword Mathmode'
246    # context => '#pop'
247    # type => 'RegExpr'
248    if ($self->testRegExpr($text, '[a-zA-Z]+', 0, 0, 0, undef, 0, '#pop', 'Keyword Mathmode')) {
249       return 1
250    }
251    # String => '[^a-zA-Z]'
252    # attribute => 'Keyword Mathmode'
253    # context => '#pop'
254    # type => 'RegExpr'
255    if ($self->testRegExpr($text, '[^a-zA-Z]', 0, 0, 0, undef, 0, '#pop', 'Keyword Mathmode')) {
256       return 1
257    }
258    return 0;
259 };
260
261 sub parseMathEnv {
262    my ($self, $text) = @_;
263    # attribute => 'Normal Text'
264    # char => '}'
265    # context => 'MathModeEnv'
266    # type => 'DetectChar'
267    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'MathModeEnv', 'Normal Text')) {
268       return 1
269    }
270    # String => '\S'
271    # attribute => 'Normal Text'
272    # context => '#pop'
273    # type => 'RegExpr'
274    if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
275       return 1
276    }
277    return 0;
278 };
279
280 sub parseMathFindEnd {
281    my ($self, $text) = @_;
282    # attribute => 'Normal Text'
283    # char => '{'
284    # context => '#stay'
285    # type => 'DetectChar'
286    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
287       return 1
288    }
289    # String => '[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\*?'
290    # attribute => 'Environment'
291    # context => '#stay'
292    # type => 'RegExpr'
293    if ($self->testRegExpr($text, '[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\*?', 0, 0, 0, undef, 0, '#stay', 'Environment')) {
294       return 1
295    }
296    # type => 'DetectSpaces'
297    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
298       return 1
299    }
300    # attribute => 'Normal Text'
301    # char => '}'
302    # context => '#pop#pop#pop#pop#pop'
303    # endRegion => 'block'
304    # type => 'DetectChar'
305    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop#pop#pop', 'Normal Text')) {
306       return 1
307    }
308    return 0;
309 };
310
311 sub parseMathMode {
312    my ($self, $text) = @_;
313    # attribute => 'Math'
314    # char => '\'
315    # char1 => ']'
316    # context => '#pop'
317    # endRegion => 'mathMode'
318    # type => 'Detect2Chars'
319    if ($self->testDetect2Chars($text, '\\', ']', 0, 0, 0, undef, 0, '#pop', 'Math')) {
320       return 1
321    }
322    # attribute => 'Math'
323    # char => '\'
324    # char1 => ')'
325    # context => '#pop'
326    # endRegion => 'mathMode'
327    # type => 'Detect2Chars'
328    if ($self->testDetect2Chars($text, '\\', ')', 0, 0, 0, undef, 0, '#pop', 'Math')) {
329       return 1
330    }
331    # String => '\\begin(?=[^a-zA-Z])'
332    # attribute => 'Keyword Mathmode'
333    # beginRegion => 'block'
334    # context => '#stay'
335    # type => 'RegExpr'
336    if ($self->testRegExpr($text, '\\\\begin(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Keyword Mathmode')) {
337       return 1
338    }
339    # String => '\\end(?=[^a-zA-Z])'
340    # attribute => 'Keyword Mathmode'
341    # context => '#stay'
342    # endRegion => 'block'
343    # type => 'RegExpr'
344    if ($self->testRegExpr($text, '\\\\end(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Keyword Mathmode')) {
345       return 1
346    }
347    # attribute => 'Keyword Mathmode'
348    # char => '\'
349    # context => 'MathContrSeq'
350    # type => 'DetectChar'
351    if ($self->testDetectChar($text, '\\', 0, 0, 0, undef, 0, 'MathContrSeq', 'Keyword Mathmode')) {
352       return 1
353    }
354    # String => '$$'
355    # attribute => 'Math'
356    # context => '#pop'
357    # endRegion => 'mathMode'
358    # type => 'StringDetect'
359    if ($self->testStringDetect($text, '$$', 0, 0, 0, undef, 0, '#pop', 'Math')) {
360       return 1
361    }
362    # attribute => 'Math'
363    # char => '$'
364    # context => '#pop'
365    # endRegion => 'mathMode'
366    # type => 'DetectChar'
367    if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, '#pop', 'Math')) {
368       return 1
369    }
370    # String => '%\s*BEGIN.*$'
371    # attribute => 'Region Marker'
372    # beginRegion => 'regionMarker'
373    # context => '#stay'
374    # firstNonSpace => 'true'
375    # type => 'RegExpr'
376    if ($self->testRegExpr($text, '%\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) {
377       return 1
378    }
379    # String => '%\s*END.*$'
380    # attribute => 'Region Marker'
381    # context => '#stay'
382    # endRegion => 'regionMarker'
383    # firstNonSpace => 'true'
384    # type => 'RegExpr'
385    if ($self->testRegExpr($text, '%\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) {
386       return 1
387    }
388    # attribute => 'Comment'
389    # char => '%'
390    # context => 'Comment'
391    # type => 'DetectChar'
392    if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
393       return 1
394    }
395    return 0;
396 };
397
398 sub parseMathModeEnv {
399    my ($self, $text) = @_;
400    # String => '\\end(?=\s*\{\s*[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\*?\s*\})'
401    # attribute => 'Structure'
402    # context => 'MathFindEnd'
403    # type => 'RegExpr'
404    if ($self->testRegExpr($text, '\\\\end(?=\\s*\\{\\s*[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\*?\\s*\\})', 0, 0, 0, undef, 0, 'MathFindEnd', 'Structure')) {
405       return 1
406    }
407    # String => '\\begin(?=[^a-zA-Z])'
408    # attribute => 'Keyword Mathmode'
409    # beginRegion => 'block'
410    # context => '#stay'
411    # type => 'RegExpr'
412    if ($self->testRegExpr($text, '\\\\begin(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Keyword Mathmode')) {
413       return 1
414    }
415    # String => '\\end(?=[^a-zA-Z])'
416    # attribute => 'Keyword Mathmode'
417    # context => '#stay'
418    # endRegion => 'block'
419    # type => 'RegExpr'
420    if ($self->testRegExpr($text, '\\\\end(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Keyword Mathmode')) {
421       return 1
422    }
423    # String => '\('
424    # attribute => 'Math'
425    # beginRegion => 'mathMode'
426    # context => 'MathMode'
427    # type => 'StringDetect'
428    if ($self->testStringDetect($text, '\\(', 0, 0, 0, undef, 0, 'MathMode', 'Math')) {
429       return 1
430    }
431    # String => '\['
432    # attribute => 'Math'
433    # beginRegion => 'mathMode'
434    # context => 'MathMode'
435    # type => 'StringDetect'
436    if ($self->testStringDetect($text, '\\[', 0, 0, 0, undef, 0, 'MathMode', 'Math')) {
437       return 1
438    }
439    # attribute => 'Keyword Mathmode'
440    # char => '\'
441    # context => 'MathContrSeq'
442    # type => 'DetectChar'
443    if ($self->testDetectChar($text, '\\', 0, 0, 0, undef, 0, 'MathContrSeq', 'Keyword Mathmode')) {
444       return 1
445    }
446    # String => '$$'
447    # attribute => 'Math'
448    # beginRegion => 'mathMode'
449    # context => 'MathMode'
450    # type => 'StringDetect'
451    if ($self->testStringDetect($text, '$$', 0, 0, 0, undef, 0, 'MathMode', 'Math')) {
452       return 1
453    }
454    # attribute => 'Math'
455    # beginRegion => 'mathMode'
456    # char => '$'
457    # context => 'MathMode'
458    # type => 'DetectChar'
459    if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, 'MathMode', 'Math')) {
460       return 1
461    }
462    # String => '%\s*BEGIN.*$'
463    # attribute => 'Region Marker'
464    # beginRegion => 'regionMarker'
465    # context => '#stay'
466    # firstNonSpace => 'true'
467    # type => 'RegExpr'
468    if ($self->testRegExpr($text, '%\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) {
469       return 1
470    }
471    # String => '%\s*END.*$'
472    # attribute => 'Region Marker'
473    # context => '#stay'
474    # endRegion => 'regionMarker'
475    # firstNonSpace => 'true'
476    # type => 'RegExpr'
477    if ($self->testRegExpr($text, '%\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) {
478       return 1
479    }
480    # attribute => 'Comment'
481    # char => '%'
482    # context => 'Comment'
483    # type => 'DetectChar'
484    if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
485       return 1
486    }
487    return 0;
488 };
489
490 sub parseNormalText {
491    my ($self, $text) = @_;
492    # String => '\\begin(?=[^a-zA-Z])'
493    # attribute => 'Structure'
494    # beginRegion => 'block'
495    # context => 'FindEnvironment'
496    # type => 'RegExpr'
497    if ($self->testRegExpr($text, '\\\\begin(?=[^a-zA-Z])', 0, 0, 0, undef, 0, 'FindEnvironment', 'Structure')) {
498       return 1
499    }
500    # String => '\\end(?=[^a-zA-Z])'
501    # attribute => 'Structure'
502    # context => 'FindEnvironment'
503    # endRegion => 'block'
504    # type => 'RegExpr'
505    if ($self->testRegExpr($text, '\\\\end(?=[^a-zA-Z])', 0, 0, 0, undef, 0, 'FindEnvironment', 'Structure')) {
506       return 1
507    }
508    # String => '\\(label|pageref|ref|cite)(?=[^a-zA-Z])'
509    # attribute => 'Structure'
510    # context => 'Label'
511    # type => 'RegExpr'
512    if ($self->testRegExpr($text, '\\\\(label|pageref|ref|cite)(?=[^a-zA-Z])', 0, 0, 0, undef, 0, 'Label', 'Structure')) {
513       return 1
514    }
515    # String => '\\(part|chapter|section|subsection|subsubsection|paragraph|subparagraph)(?=[^a-zA-Z])'
516    # attribute => 'Structure'
517    # context => '#stay'
518    # type => 'RegExpr'
519    if ($self->testRegExpr($text, '\\\\(part|chapter|section|subsection|subsubsection|paragraph|subparagraph)(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Structure')) {
520       return 1
521    }
522    # String => '\renewcommand'
523    # attribute => 'Keyword'
524    # context => 'ToEndOfLine'
525    # type => 'StringDetect'
526    if ($self->testStringDetect($text, '\\renewcommand', 0, 0, 0, undef, 0, 'ToEndOfLine', 'Keyword')) {
527       return 1
528    }
529    # String => '\newcommand'
530    # attribute => 'Keyword'
531    # context => 'ToEndOfLine'
532    # type => 'StringDetect'
533    if ($self->testStringDetect($text, '\\newcommand', 0, 0, 0, undef, 0, 'ToEndOfLine', 'Keyword')) {
534       return 1
535    }
536    # String => '\('
537    # attribute => 'Math'
538    # beginRegion => 'mathMode'
539    # context => 'MathMode'
540    # type => 'StringDetect'
541    if ($self->testStringDetect($text, '\\(', 0, 0, 0, undef, 0, 'MathMode', 'Math')) {
542       return 1
543    }
544    # String => '\['
545    # attribute => 'Math'
546    # beginRegion => 'mathMode'
547    # context => 'MathMode'
548    # type => 'StringDetect'
549    if ($self->testStringDetect($text, '\\[', 0, 0, 0, undef, 0, 'MathMode', 'Math')) {
550       return 1
551    }
552    # attribute => 'Keyword'
553    # char => '\'
554    # context => 'ContrSeq'
555    # type => 'DetectChar'
556    if ($self->testDetectChar($text, '\\', 0, 0, 0, undef, 0, 'ContrSeq', 'Keyword')) {
557       return 1
558    }
559    # String => '$$'
560    # attribute => 'Math'
561    # beginRegion => 'mathMode'
562    # context => 'MathMode'
563    # type => 'StringDetect'
564    if ($self->testStringDetect($text, '$$', 0, 0, 0, undef, 0, 'MathMode', 'Math')) {
565       return 1
566    }
567    # attribute => 'Math'
568    # beginRegion => 'mathMode'
569    # char => '$'
570    # context => 'MathMode'
571    # type => 'DetectChar'
572    if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, 'MathMode', 'Math')) {
573       return 1
574    }
575    # String => '%\s*BEGIN.*$'
576    # attribute => 'Region Marker'
577    # beginRegion => 'regionMarker'
578    # context => '#stay'
579    # firstNonSpace => 'true'
580    # type => 'RegExpr'
581    if ($self->testRegExpr($text, '%\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) {
582       return 1
583    }
584    # String => '%\s*END.*$'
585    # attribute => 'Region Marker'
586    # context => '#stay'
587    # endRegion => 'regionMarker'
588    # firstNonSpace => 'true'
589    # type => 'RegExpr'
590    if ($self->testRegExpr($text, '%\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) {
591       return 1
592    }
593    # attribute => 'Comment'
594    # char => '%'
595    # context => 'Comment'
596    # type => 'DetectChar'
597    if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
598       return 1
599    }
600    return 0;
601 };
602
603 sub parseToEndOfLine {
604    my ($self, $text) = @_;
605    return 0;
606 };
607
608 sub parseVerb {
609    my ($self, $text) = @_;
610    # String => '(.).*\1'
611    # attribute => 'Verbatim'
612    # context => '#pop#pop'
613    # minimal => 'true'
614    # type => 'RegExpr'
615    if ($self->testRegExpr($text, '(.).*?\\1', 0, 0, 0, undef, 0, '#pop#pop', 'Verbatim')) {
616       return 1
617    }
618    return 0;
619 };
620
621 sub parseVerbFindEnd {
622    my ($self, $text) = @_;
623    # attribute => 'Normal Text'
624    # char => '{'
625    # context => '#stay'
626    # type => 'DetectChar'
627    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
628       return 1
629    }
630    # String => '(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\*?'
631    # attribute => 'Environment'
632    # context => '#stay'
633    # type => 'RegExpr'
634    if ($self->testRegExpr($text, '(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\\*?', 0, 0, 0, undef, 0, '#stay', 'Environment')) {
635       return 1
636    }
637    # attribute => 'Normal Text'
638    # char => '}'
639    # context => '#pop#pop#pop#pop#pop'
640    # endRegion => 'block'
641    # type => 'DetectChar'
642    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop#pop#pop', 'Normal Text')) {
643       return 1
644    }
645    return 0;
646 };
647
648 sub parseVerbatim {
649    my ($self, $text) = @_;
650    # String => '\\end(?=\{(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\*?\})'
651    # attribute => 'Structure'
652    # context => 'VerbFindEnd'
653    # type => 'RegExpr'
654    if ($self->testRegExpr($text, '\\\\end(?=\\{(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\\*?\\})', 0, 0, 0, undef, 0, 'VerbFindEnd', 'Structure')) {
655       return 1
656    }
657    return 0;
658 };
659
660 sub parseVerbatimEnv {
661    my ($self, $text) = @_;
662    # attribute => 'Normal Text'
663    # char => '*'
664    # context => '#stay'
665    # type => 'DetectChar'
666    if ($self->testDetectChar($text, '*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
667       return 1
668    }
669    # attribute => 'Normal Text'
670    # char => '}'
671    # context => 'Verbatim'
672    # type => 'DetectChar'
673    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'Verbatim', 'Normal Text')) {
674       return 1
675    }
676    # String => '\S'
677    # attribute => 'Normal Text'
678    # context => '#pop'
679    # type => 'RegExpr'
680    if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
681       return 1
682    }
683    return 0;
684 };
685
686
687 1;
688
689 __END__
690
691 =head1 NAME
692
693 Syntax::Highlight::Engine::Kate::LaTeX - a Plugin for LaTeX syntax highlighting
694
695 =head1 SYNOPSIS
696
697  require Syntax::Highlight::Engine::Kate::LaTeX;
698  my $sh = new Syntax::Highlight::Engine::Kate::LaTeX([
699  ]);
700
701 =head1 DESCRIPTION
702
703 Syntax::Highlight::Engine::Kate::LaTeX is a  plugin module that provides syntax highlighting
704 for LaTeX to the Syntax::Haghlight::Engine::Kate highlighting engine.
705
706 This code is generated from the syntax definition files used
707 by the Kate project.
708 It works quite fine, but can use refinement and optimization.
709
710 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
711
712 =cut
713
714 =head1 AUTHOR
715
716 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
717
718 =cut
719
720 =head1 BUGS
721
722 Unknown. If you find any, please contact the author
723
724 =cut
725