| 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 | 1 | our $VERSION = '0.16'; | |||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 17 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 18 | 1 | ▶ | use base('Syntax::Highlight::Engine::Kate::Template'); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 1 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||
| 21 | 1 | my $proto = shift; | |||||||||||||||||||
| 22 | 1 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||
|
Condition33%1/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||
| 23 | 1 | my $self = $class->SUPER::new(@_); | |||||||||||||||||||
| 24 | 1 | $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 | $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 | $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 | $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 | $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); | |||||||||||||||||||
| 139 | 1 | $self->basecontext('Normal'); | |||||||||||||||||||
| 140 | 1 | $self->keywordscase(0); | |||||||||||||||||||
| 141 | 1 | $self->initialize; | |||||||||||||||||||
| 142 | 1 | bless ($self, $class); | |||||||||||||||||||
| 143 | 1 | return $self; | |||||||||||||||||||
| 144 | } | ||||||||||||||||||||
| 145 | |||||||||||||||||||||
| 146 | 0 | ▶ | sub language { | ||||||||||||||||||
|
Subroutine
language: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 147 | 0 | return 'REXX'; | |||||||||||||||||||
| 148 | } | ||||||||||||||||||||
| 149 | |||||||||||||||||||||
| 150 | 0 | ▶ | sub parseCommentar1 { | ||||||||||||||||||
|
Subroutine
parseCommentar1: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||
| 151 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 152 | # String => '(FIXME|TODO)' | ||||||||||||||||||||
| 153 | # attribute => 'Alert' | ||||||||||||||||||||
| 154 | # context => '#stay' | ||||||||||||||||||||
| 155 | # type => 'RegExpr' | ||||||||||||||||||||
| 156 | 0 | ▶ | if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 157 | 0 | return 1 | |||||||||||||||||||
| 158 | } | ||||||||||||||||||||
| 159 | # attribute => 'Comment' | ||||||||||||||||||||
| 160 | # char => '*' | ||||||||||||||||||||
| 161 | # char1 => '/' | ||||||||||||||||||||
| 162 | # context => '#pop' | ||||||||||||||||||||
| 163 | # endRegion => 'Comment' | ||||||||||||||||||||
| 164 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 165 | 0 | ▶ | if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 166 | 0 | return 1 | |||||||||||||||||||
| 167 | } | ||||||||||||||||||||
| 168 | 0 | return 0; | |||||||||||||||||||
| 169 | }; | ||||||||||||||||||||
| 170 | |||||||||||||||||||||
| 171 | 0 | ▶ | sub parseNormal { | ||||||||||||||||||
|
Subroutine
parseNormal: not called CC=12 SCAR=50.5
Pod
undocumented
| |||||||||||||||||||||
| 172 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 173 | # String => 'instructions' | ||||||||||||||||||||
| 174 | # attribute => 'Instructions' | ||||||||||||||||||||
| 175 | # context => '#stay' | ||||||||||||||||||||
| 176 | # type => 'keyword' | ||||||||||||||||||||
| 177 | 0 | ▶ | if ($self->testKeyword($text, 'instructions', 0, undef, 0, '#stay', 'Instructions')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 178 | 0 | return 1 | |||||||||||||||||||
| 179 | } | ||||||||||||||||||||
| 180 | # String => 'builtin' | ||||||||||||||||||||
| 181 | # attribute => 'Built In' | ||||||||||||||||||||
| 182 | # context => '#stay' | ||||||||||||||||||||
| 183 | # type => 'keyword' | ||||||||||||||||||||
| 184 | 0 | ▶ | if ($self->testKeyword($text, 'builtin', 0, undef, 0, '#stay', 'Built In')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 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 | ▶ | if ($self->testRegExpr($text, '\\bsignal([\\s]*(on|off)[\\s]*(error|failure|halt|notready|novalue|syntax|lostdigits))*', 1, 0, 0, undef, 0, '#stay', 'Instructions')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 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 | ▶ | if ($self->testRegExpr($text, '\\bcall([\\s]*(on|off)[\\s]*(error|failure|halt|notready))*', 1, 0, 0, undef, 0, '#stay', 'Instructions')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 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 | ▶ | if ($self->testRegExpr($text, '\\b(trace|address)\\s*[_\\w\\d]', 1, 0, 0, undef, 0, '#stay', 'Instructions')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 209 | 0 | return 1 | |||||||||||||||||||
| 210 | } | ||||||||||||||||||||
| 211 | # String => '\bprocedure([\s]*expose)?' | ||||||||||||||||||||
| 212 | # attribute => 'Instructions' | ||||||||||||||||||||
| 213 | # context => '#stay' | ||||||||||||||||||||
| 214 | # insensitive => 'true' | ||||||||||||||||||||
| 215 | # type => 'RegExpr' | ||||||||||||||||||||
| 216 | 0 | ▶ | if ($self->testRegExpr($text, '\\bprocedure([\\s]*expose)?', 1, 0, 0, undef, 0, '#stay', 'Instructions')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 217 | 0 | return 1 | |||||||||||||||||||
| 218 | } | ||||||||||||||||||||
| 219 | # String => '\bdo([\s]*forever)?' | ||||||||||||||||||||
| 220 | # attribute => 'Instructions' | ||||||||||||||||||||
| 221 | # context => '#stay' | ||||||||||||||||||||
| 222 | # insensitive => 'true' | ||||||||||||||||||||
| 223 | # type => 'RegExpr' | ||||||||||||||||||||
| 224 | 0 | ▶ | if ($self->testRegExpr($text, '\\bdo([\\s]*forever)?', 1, 0, 0, undef, 0, '#stay', 'Instructions')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 225 | 0 | return 1 | |||||||||||||||||||
| 226 | } | ||||||||||||||||||||
| 227 | # attribute => 'String' | ||||||||||||||||||||
| 228 | # char => ''' | ||||||||||||||||||||
| 229 | # context => 'String' | ||||||||||||||||||||
| 230 | # type => 'DetectChar' | ||||||||||||||||||||
| 231 | 0 | ▶ | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String', 'String')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 232 | 0 | return 1 | |||||||||||||||||||
| 233 | } | ||||||||||||||||||||
| 234 | # attribute => 'Comment' | ||||||||||||||||||||
| 235 | # beginRegion => 'Comment' | ||||||||||||||||||||
| 236 | # char => '/' | ||||||||||||||||||||
| 237 | # char1 => '*' | ||||||||||||||||||||
| 238 | # context => 'Commentar 1' | ||||||||||||||||||||
| 239 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 240 | 0 | ▶ | if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 241 | 0 | return 1 | |||||||||||||||||||
| 242 | } | ||||||||||||||||||||
| 243 | # String => ':!%&()+,-/.*<=>?[]{|}~^;' | ||||||||||||||||||||
| 244 | # attribute => 'Symbol' | ||||||||||||||||||||
| 245 | # context => '#stay' | ||||||||||||||||||||
| 246 | # type => 'AnyChar' | ||||||||||||||||||||
| 247 | 0 | ▶ | if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]{|}~^;', 0, 0, undef, 0, '#stay', 'Symbol')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 248 | 0 | return 1 | |||||||||||||||||||
| 249 | } | ||||||||||||||||||||
| 250 | # String => '\b[_\w][_\w\d]*(?=[\s]*[(:])' | ||||||||||||||||||||
| 251 | # attribute => 'Function' | ||||||||||||||||||||
| 252 | # context => '#stay' | ||||||||||||||||||||
| 253 | # type => 'RegExpr' | ||||||||||||||||||||
| 254 | 0 | ▶ | if ($self->testRegExpr($text, '\\b[_\\w][_\\w\\d]*(?=[\\s]*[(:])', 0, 0, 0, undef, 0, '#stay', 'Function')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 255 | 0 | return 1 | |||||||||||||||||||
| 256 | } | ||||||||||||||||||||
| 257 | 0 | return 0; | |||||||||||||||||||
| 258 | }; | ||||||||||||||||||||
| 259 | |||||||||||||||||||||
| 260 | 0 | ▶ | sub parseString { | ||||||||||||||||||
|
Subroutine
parseString: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||
| 261 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 262 | # attribute => 'String' | ||||||||||||||||||||
| 263 | # context => '#stay' | ||||||||||||||||||||
| 264 | # type => 'LineContinue' | ||||||||||||||||||||
| 265 | 0 | ▶ | if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 266 | 0 | return 1 | |||||||||||||||||||
| 267 | } | ||||||||||||||||||||
| 268 | # attribute => 'String' | ||||||||||||||||||||
| 269 | # char => ''' | ||||||||||||||||||||
| 270 | # context => '#pop' | ||||||||||||||||||||
| 271 | # type => 'DetectChar' | ||||||||||||||||||||
| 272 | 0 | ▶ | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 273 | 0 | return 1 | |||||||||||||||||||
| 274 | } | ||||||||||||||||||||
| 275 | 0 | return 0; | |||||||||||||||||||
| 276 | }; | ||||||||||||||||||||
| 277 | |||||||||||||||||||||
| 278 | |||||||||||||||||||||
| 279 | 1 | 1; | |||||||||||||||||||
| 280 | |||||||||||||||||||||
| 281 | __END__ | ||||||||||||||||||||