File Coverage

blib/lib/Syntax/Highlight/Engine/Kate/REXX.pm
Criterion Covered Total %
statement 22 59 37.2
branch 0 30 0.0
condition 1 3 33.3
subroutine 4 8 50.0
pod 0 5 0.0
total 27 105 25.7


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 'rexx.xml' file of the syntax highlight
6             # engine of the kate text editor (http://www.kate-editor.org
7              
8             #kate xml version 1.01
9             #kate version 2.3
10             #generated: Sun Feb 3 22:02:06 2008, localtime
11              
12             package Syntax::Highlight::Engine::Kate::REXX;
13              
14             our $VERSION = '0.14';
15              
16 1     1   488 use strict;
  1         3  
  1         25  
17 1     1   4 use warnings;
  1         2  
  1         23  
18 1     1   4 use base('Syntax::Highlight::Engine::Kate::Template');
  1         2  
  1         663  
19              
20             sub new {
21 1     1 0 592 my $proto = shift;
22 1   33     7 my $class = ref($proto) || $proto;
23 1         7 my $self = $class->SUPER::new(@_);
24 1         9 $self->attributes({
25             'Alert' => 'Alert',
26             'Built In' => 'Normal',
27             'Comment' => 'Comment',
28             'Function' => 'Function',
29             'Instructions' => 'Keyword',
30             'Normal Text' => 'Normal',
31             'String' => 'String',
32             'Symbol' => 'Normal',
33             });
34 1         5 $self->listAdd('builtin',
35             'abbrev',
36             'abs',
37             'address',
38             'b2x',
39             'bitand',
40             'bitor',
41             'bitxor',
42             'c2d',
43             'c2x',
44             'center',
45             'charin',
46             'charout',
47             'chars',
48             'compare',
49             'condition',
50             'copies',
51             'd2c',
52             'd2x',
53             'datatype',
54             'date',
55             'delstr',
56             'delword',
57             'digits',
58             'errortext',
59             'form',
60             'format',
61             'fuzz',
62             'insert',
63             'lastpos',
64             'left',
65             'linein',
66             'lineout',
67             'lines',
68             'max',
69             'min',
70             'overlay',
71             'pos',
72             'queued',
73             'random',
74             'reverse',
75             'right',
76             'sign',
77             'sourceline',
78             'space',
79             'stream',
80             'strip',
81             'substr',
82             'subword',
83             'symbol',
84             'time',
85             'trace',
86             'translate',
87             'trunc',
88             'value',
89             'verify',
90             'word',
91             'wordindex',
92             'wordlength',
93             'wordpos',
94             'words',
95             'x2b',
96             'x2c',
97             'x2d',
98             'xrange',
99             );
100 1         4 $self->listAdd('instructions',
101             'arg',
102             'drop',
103             'else',
104             'end',
105             'exit',
106             'forever',
107             'if',
108             'interpret',
109             'iterate',
110             'leave',
111             'nop',
112             'options',
113             'otherwise',
114             'pull',
115             'push',
116             'queue',
117             'return',
118             'say',
119             'select',
120             'syntax',
121             'then',
122             );
123 1         10 $self->contextdata({
124             'Commentar 1' => {
125             callback => \&parseCommentar1,
126             attribute => 'Comment',
127             },
128             'Normal' => {
129             callback => \&parseNormal,
130             attribute => 'Normal Text',
131             },
132             'String' => {
133             callback => \&parseString,
134             attribute => 'String',
135             lineending => '#pop',
136             },
137             });
138 1         4 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
139 1         4 $self->basecontext('Normal');
140 1         4 $self->keywordscase(0);
141 1         3 $self->initialize;
142 1         2 bless ($self, $class);
143 1         3 return $self;
144             }
145              
146             sub language {
147 0     0 0   return 'REXX';
148             }
149              
150             sub parseCommentar1 {
151 0     0 0   my ($self, $text) = @_;
152             # String => '(FIXME|TODO)'
153             # attribute => 'Alert'
154             # context => '#stay'
155             # type => 'RegExpr'
156 0 0         if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) {
157 0           return 1
158             }
159             # attribute => 'Comment'
160             # char => '*'
161             # char1 => '/'
162             # context => '#pop'
163             # endRegion => 'Comment'
164             # type => 'Detect2Chars'
165 0 0         if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
166 0           return 1
167             }
168 0           return 0;
169             };
170              
171             sub parseNormal {
172 0     0 0   my ($self, $text) = @_;
173             # String => 'instructions'
174             # attribute => 'Instructions'
175             # context => '#stay'
176             # type => 'keyword'
177 0 0         if ($self->testKeyword($text, 'instructions', 0, undef, 0, '#stay', 'Instructions')) {
178 0           return 1
179             }
180             # String => 'builtin'
181             # attribute => 'Built In'
182             # context => '#stay'
183             # type => 'keyword'
184 0 0         if ($self->testKeyword($text, 'builtin', 0, undef, 0, '#stay', 'Built In')) {
185 0           return 1
186             }
187             # String => '\bsignal([\s]*(on|off)[\s]*(error|failure|halt|notready|novalue|syntax|lostdigits))*'
188             # attribute => 'Instructions'
189             # context => '#stay'
190             # insensitive => 'true'
191             # type => 'RegExpr'
192 0 0         if ($self->testRegExpr($text, '\\bsignal([\\s]*(on|off)[\\s]*(error|failure|halt|notready|novalue|syntax|lostdigits))*', 1, 0, 0, undef, 0, '#stay', 'Instructions')) {
193 0           return 1
194             }
195             # String => '\bcall([\s]*(on|off)[\s]*(error|failure|halt|notready))*'
196             # attribute => 'Instructions'
197             # context => '#stay'
198             # insensitive => 'true'
199             # type => 'RegExpr'
200 0 0         if ($self->testRegExpr($text, '\\bcall([\\s]*(on|off)[\\s]*(error|failure|halt|notready))*', 1, 0, 0, undef, 0, '#stay', 'Instructions')) {
201 0           return 1
202             }
203             # String => '\b(trace|address)\s*[_\w\d]'
204             # attribute => 'Instructions'
205             # context => '#stay'
206             # insensitive => 'true'
207             # type => 'RegExpr'
208 0 0         if ($self->testRegExpr($text, '\\b(trace|address)\\s*[_\\w\\d]', 1, 0, 0, undef, 0, '#stay', 'Instructions')) {
209 0           return 1
210             }
211             # String => '\bprocedure([\s]*expose)?'
212             # attribute => 'Instructions'
213             # context => '#stay'
214             # insensitive => 'true'
215             # type => 'RegExpr'
216 0 0         if ($self->testRegExpr($text, '\\bprocedure([\\s]*expose)?', 1, 0, 0, undef, 0, '#stay', 'Instructions')) {
217 0           return 1
218             }
219             # String => '\bdo([\s]*forever)?'
220             # attribute => 'Instructions'
221             # context => '#stay'
222             # insensitive => 'true'
223             # type => 'RegExpr'
224 0 0         if ($self->testRegExpr($text, '\\bdo([\\s]*forever)?', 1, 0, 0, undef, 0, '#stay', 'Instructions')) {
225 0           return 1
226             }
227             # attribute => 'String'
228             # char => '''
229             # context => 'String'
230             # type => 'DetectChar'
231 0 0         if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String', 'String')) {
232 0           return 1
233             }
234             # attribute => 'Comment'
235             # beginRegion => 'Comment'
236             # char => '/'
237             # char1 => '*'
238             # context => 'Commentar 1'
239             # type => 'Detect2Chars'
240 0 0         if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) {
241 0           return 1
242             }
243             # String => ':!%&()+,-/.*<=>?[]{|}~^;'
244             # attribute => 'Symbol'
245             # context => '#stay'
246             # type => 'AnyChar'
247 0 0         if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]{|}~^;', 0, 0, undef, 0, '#stay', 'Symbol')) {
248 0           return 1
249             }
250             # String => '\b[_\w][_\w\d]*(?=[\s]*[(:])'
251             # attribute => 'Function'
252             # context => '#stay'
253             # type => 'RegExpr'
254 0 0         if ($self->testRegExpr($text, '\\b[_\\w][_\\w\\d]*(?=[\\s]*[(:])', 0, 0, 0, undef, 0, '#stay', 'Function')) {
255 0           return 1
256             }
257 0           return 0;
258             };
259              
260             sub parseString {
261 0     0 0   my ($self, $text) = @_;
262             # attribute => 'String'
263             # context => '#stay'
264             # type => 'LineContinue'
265 0 0         if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
266 0           return 1
267             }
268             # attribute => 'String'
269             # char => '''
270             # context => '#pop'
271             # type => 'DetectChar'
272 0 0         if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
273 0           return 1
274             }
275 0           return 0;
276             };
277              
278              
279             1;
280              
281             __END__