| 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 'pike.xml' file of the syntax highlight | ||||||||||||||||||||
| 6 | # engine of the kate text editor (http://www.kate-editor.org | ||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | #kate xml version 1.07 | ||||||||||||||||||||
| 9 | #kate version 2.4 | ||||||||||||||||||||
| 10 | #kate author Paul Pogonyshev | ||||||||||||||||||||
| 11 | #generated: Sun Feb 3 22:02:06 2008, localtime | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | package Syntax::Highlight::Engine::Kate::Pike; | ||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 1 | our $VERSION = '0.16'; | |||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 18 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 19 | 1 | ▶ | use base('Syntax::Highlight::Engine::Kate::Template'); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 2 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||
| 22 | 2 | my $proto = shift; | |||||||||||||||||||
| 23 | 2 | ▶ | 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
| |||||||||||||||||||||
| 24 | 2 | my $self = $class->SUPER::new(@_); | |||||||||||||||||||
| 25 | 2 | $self->attributes({ | |||||||||||||||||||
| 26 | 'Binary' => 'BaseN', | ||||||||||||||||||||
| 27 | 'Builtin Function' => 'Function', | ||||||||||||||||||||
| 28 | 'Char' => 'Char', | ||||||||||||||||||||
| 29 | 'Comment' => 'Comment', | ||||||||||||||||||||
| 30 | 'Data Type' => 'DataType', | ||||||||||||||||||||
| 31 | 'Decimal' => 'DecVal', | ||||||||||||||||||||
| 32 | 'Float' => 'Float', | ||||||||||||||||||||
| 33 | 'Hex' => 'BaseN', | ||||||||||||||||||||
| 34 | 'Keyword' => 'Keyword', | ||||||||||||||||||||
| 35 | 'Normal Text' => 'Normal', | ||||||||||||||||||||
| 36 | 'Note' => 'Alert', | ||||||||||||||||||||
| 37 | 'Octal' => 'BaseN', | ||||||||||||||||||||
| 38 | 'Preprocessor' => 'Others', | ||||||||||||||||||||
| 39 | 'Preprocessor Lib' => 'String', | ||||||||||||||||||||
| 40 | 'String' => 'String', | ||||||||||||||||||||
| 41 | 'String Char' => 'Char', | ||||||||||||||||||||
| 42 | }); | ||||||||||||||||||||
| 43 | 2 | $self->listAdd('builtins', | |||||||||||||||||||
| 44 | 'catch', | ||||||||||||||||||||
| 45 | 'gauge', | ||||||||||||||||||||
| 46 | 'sscanf', | ||||||||||||||||||||
| 47 | 'typeof', | ||||||||||||||||||||
| 48 | ); | ||||||||||||||||||||
| 49 | 2 | $self->listAdd('keywords', | |||||||||||||||||||
| 50 | 'break', | ||||||||||||||||||||
| 51 | 'case', | ||||||||||||||||||||
| 52 | 'class', | ||||||||||||||||||||
| 53 | 'continue', | ||||||||||||||||||||
| 54 | 'default', | ||||||||||||||||||||
| 55 | 'do', | ||||||||||||||||||||
| 56 | 'else', | ||||||||||||||||||||
| 57 | 'for', | ||||||||||||||||||||
| 58 | 'foreach', | ||||||||||||||||||||
| 59 | 'if', | ||||||||||||||||||||
| 60 | 'return', | ||||||||||||||||||||
| 61 | 'switch', | ||||||||||||||||||||
| 62 | 'while', | ||||||||||||||||||||
| 63 | ); | ||||||||||||||||||||
| 64 | 2 | $self->listAdd('types', | |||||||||||||||||||
| 65 | 'array', | ||||||||||||||||||||
| 66 | 'float', | ||||||||||||||||||||
| 67 | 'function', | ||||||||||||||||||||
| 68 | 'int', | ||||||||||||||||||||
| 69 | 'mapping', | ||||||||||||||||||||
| 70 | 'mixed', | ||||||||||||||||||||
| 71 | 'multiset>', | ||||||||||||||||||||
| 72 | 'object', | ||||||||||||||||||||
| 73 | 'program', | ||||||||||||||||||||
| 74 | 'static', | ||||||||||||||||||||
| 75 | 'string', | ||||||||||||||||||||
| 76 | 'void', | ||||||||||||||||||||
| 77 | ); | ||||||||||||||||||||
| 78 | 2 | $self->contextdata({ | |||||||||||||||||||
| 79 | 'Block Comment' => { | ||||||||||||||||||||
| 80 | callback => \&parseBlockComment, | ||||||||||||||||||||
| 81 | attribute => 'Comment', | ||||||||||||||||||||
| 82 | }, | ||||||||||||||||||||
| 83 | 'Line Comment' => { | ||||||||||||||||||||
| 84 | callback => \&parseLineComment, | ||||||||||||||||||||
| 85 | attribute => 'Comment', | ||||||||||||||||||||
| 86 | lineending => '#pop', | ||||||||||||||||||||
| 87 | }, | ||||||||||||||||||||
| 88 | 'Normal' => { | ||||||||||||||||||||
| 89 | callback => \&parseNormal, | ||||||||||||||||||||
| 90 | attribute => 'Normal Text', | ||||||||||||||||||||
| 91 | }, | ||||||||||||||||||||
| 92 | 'Outscoped' => { | ||||||||||||||||||||
| 93 | callback => \&parseOutscoped, | ||||||||||||||||||||
| 94 | attribute => 'Comment', | ||||||||||||||||||||
| 95 | }, | ||||||||||||||||||||
| 96 | 'Outscoped intern' => { | ||||||||||||||||||||
| 97 | callback => \&parseOutscopedintern, | ||||||||||||||||||||
| 98 | attribute => 'Comment', | ||||||||||||||||||||
| 99 | }, | ||||||||||||||||||||
| 100 | 'Preprocessor' => { | ||||||||||||||||||||
| 101 | callback => \&parsePreprocessor, | ||||||||||||||||||||
| 102 | attribute => 'Preprocessor', | ||||||||||||||||||||
| 103 | lineending => '#pop', | ||||||||||||||||||||
| 104 | }, | ||||||||||||||||||||
| 105 | 'String' => { | ||||||||||||||||||||
| 106 | callback => \&parseString, | ||||||||||||||||||||
| 107 | attribute => 'String', | ||||||||||||||||||||
| 108 | lineending => '#pop', | ||||||||||||||||||||
| 109 | }, | ||||||||||||||||||||
| 110 | }); | ||||||||||||||||||||
| 111 | 2 | $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); | |||||||||||||||||||
| 112 | 2 | $self->basecontext('Normal'); | |||||||||||||||||||
| 113 | 2 | $self->keywordscase(0); | |||||||||||||||||||
| 114 | 2 | $self->initialize; | |||||||||||||||||||
| 115 | 2 | bless ($self, $class); | |||||||||||||||||||
| 116 | 2 | return $self; | |||||||||||||||||||
| 117 | } | ||||||||||||||||||||
| 118 | |||||||||||||||||||||
| 119 | 0 | ▶ | sub language { | ||||||||||||||||||
|
Subroutine
language: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 120 | 0 | return 'Pike'; | |||||||||||||||||||
| 121 | } | ||||||||||||||||||||
| 122 | |||||||||||||||||||||
| 123 | 286 | ▶ | sub parseBlockComment { | ||||||||||||||||||
|
Subroutine
parseBlockComment: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||
| 124 | 286 | my ($self, $text) = @_; | |||||||||||||||||||
| 125 | # attribute => 'Comment' | ||||||||||||||||||||
| 126 | # char => '*' | ||||||||||||||||||||
| 127 | # char1 => '/' | ||||||||||||||||||||
| 128 | # context => '#pop' | ||||||||||||||||||||
| 129 | # endRegion => 'Comment' | ||||||||||||||||||||
| 130 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 131 | 286 | ▶ | if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 132 | 4 | return 1 | |||||||||||||||||||
| 133 | } | ||||||||||||||||||||
| 134 | # String => '(FIXME|TODO|NOT(IC)?E):?' | ||||||||||||||||||||
| 135 | # attribute => 'Note' | ||||||||||||||||||||
| 136 | # context => '#stay' | ||||||||||||||||||||
| 137 | # type => 'RegExpr' | ||||||||||||||||||||
| 138 | 282 | ▶ | if ($self->testRegExpr($text, '(FIXME|TODO|NOT(IC)?E):?', 0, 0, 0, undef, 0, '#stay', 'Note')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 139 | 2 | return 1 | |||||||||||||||||||
| 140 | } | ||||||||||||||||||||
| 141 | 280 | return 0; | |||||||||||||||||||
| 142 | }; | ||||||||||||||||||||
| 143 | |||||||||||||||||||||
| 144 | 92 | ▶ | sub parseLineComment { | ||||||||||||||||||
|
Subroutine
parseLineComment: called CC=2 SCAR=7.6
Pod
undocumented
| |||||||||||||||||||||
| 145 | 92 | my ($self, $text) = @_; | |||||||||||||||||||
| 146 | # String => '(FIXME|TODO|NOT(IC)?E):?' | ||||||||||||||||||||
| 147 | # attribute => 'Note' | ||||||||||||||||||||
| 148 | # context => '#stay' | ||||||||||||||||||||
| 149 | # type => 'RegExpr' | ||||||||||||||||||||
| 150 | 92 | ▶ | if ($self->testRegExpr($text, '(FIXME|TODO|NOT(IC)?E):?', 0, 0, 0, undef, 0, '#stay', 'Note')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 151 | 0 | return 1 | |||||||||||||||||||
| 152 | } | ||||||||||||||||||||
| 153 | 92 | return 0; | |||||||||||||||||||
| 154 | }; | ||||||||||||||||||||
| 155 | |||||||||||||||||||||
| 156 | 438 | ▶ | sub parseNormal { | ||||||||||||||||||
|
Subroutine
parseNormal: called CC=19 SCAR=30.7
Pod
undocumented
| |||||||||||||||||||||
| 157 | 438 | my ($self, $text) = @_; | |||||||||||||||||||
| 158 | # String => 'keywords' | ||||||||||||||||||||
| 159 | # attribute => 'Keyword' | ||||||||||||||||||||
| 160 | # context => '#stay' | ||||||||||||||||||||
| 161 | # type => 'keyword' | ||||||||||||||||||||
| 162 | 438 | ▶ | if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 163 | 4 | return 1 | |||||||||||||||||||
| 164 | } | ||||||||||||||||||||
| 165 | # String => 'types' | ||||||||||||||||||||
| 166 | # attribute => 'Data Type' | ||||||||||||||||||||
| 167 | # context => '#stay' | ||||||||||||||||||||
| 168 | # type => 'keyword' | ||||||||||||||||||||
| 169 | 434 | ▶ | if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 170 | 10 | return 1 | |||||||||||||||||||
| 171 | } | ||||||||||||||||||||
| 172 | # String => 'builtins' | ||||||||||||||||||||
| 173 | # attribute => 'Builtin Function' | ||||||||||||||||||||
| 174 | # context => '#stay' | ||||||||||||||||||||
| 175 | # type => 'keyword' | ||||||||||||||||||||
| 176 | 424 | ▶ | if ($self->testKeyword($text, 'builtins', 0, undef, 0, '#stay', 'Builtin Function')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 177 | 0 | return 1 | |||||||||||||||||||
| 178 | } | ||||||||||||||||||||
| 179 | # String => '`([\+\-\*/%~&\|^]|[!=<>]=|<<?|>>?|(\[\]|->)=?)' | ||||||||||||||||||||
| 180 | # attribute => 'Builtin Function' | ||||||||||||||||||||
| 181 | # context => '#stay' | ||||||||||||||||||||
| 182 | # type => 'RegExpr' | ||||||||||||||||||||
| 183 | 424 | ▶ | if ($self->testRegExpr($text, '`([\\+\\-\\*/%~&\\|^]|[!=<>]=|<<?|>>?|(\\[\\]|->)=?)', 0, 0, 0, undef, 0, '#stay', 'Builtin Function')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 184 | 4 | return 1 | |||||||||||||||||||
| 185 | } | ||||||||||||||||||||
| 186 | # attribute => 'Float' | ||||||||||||||||||||
| 187 | # context => '#stay' | ||||||||||||||||||||
| 188 | # type => 'Float' | ||||||||||||||||||||
| 189 | 420 | ▶ | if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 190 | 6 | return 1 | |||||||||||||||||||
| 191 | } | ||||||||||||||||||||
| 192 | # String => '0[bB][01]+' | ||||||||||||||||||||
| 193 | # attribute => 'Binary' | ||||||||||||||||||||
| 194 | # context => '#stay' | ||||||||||||||||||||
| 195 | # type => 'RegExpr' | ||||||||||||||||||||
| 196 | 414 | ▶ | if ($self->testRegExpr($text, '0[bB][01]+', 0, 0, 0, undef, 0, '#stay', 'Binary')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 197 | 0 | return 1 | |||||||||||||||||||
| 198 | } | ||||||||||||||||||||
| 199 | # attribute => 'Octal' | ||||||||||||||||||||
| 200 | # context => '#stay' | ||||||||||||||||||||
| 201 | # type => 'HlCOct' | ||||||||||||||||||||
| 202 | 414 | ▶ | if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 203 | 0 | return 1 | |||||||||||||||||||
| 204 | } | ||||||||||||||||||||
| 205 | # attribute => 'Hex' | ||||||||||||||||||||
| 206 | # context => '#stay' | ||||||||||||||||||||
| 207 | # type => 'HlCHex' | ||||||||||||||||||||
| 208 | 414 | ▶ | if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 209 | 0 | return 1 | |||||||||||||||||||
| 210 | } | ||||||||||||||||||||
| 211 | # attribute => 'Decimal' | ||||||||||||||||||||
| 212 | # context => '#stay' | ||||||||||||||||||||
| 213 | # type => 'Int' | ||||||||||||||||||||
| 214 | 414 | ▶ | if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 215 | 0 | return 1 | |||||||||||||||||||
| 216 | } | ||||||||||||||||||||
| 217 | # attribute => 'Char' | ||||||||||||||||||||
| 218 | # context => '#stay' | ||||||||||||||||||||
| 219 | # type => 'HlCChar' | ||||||||||||||||||||
| 220 | 414 | ▶ | if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 221 | 0 | return 1 | |||||||||||||||||||
| 222 | } | ||||||||||||||||||||
| 223 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 224 | # beginRegion => 'Brace' | ||||||||||||||||||||
| 225 | # char => '{' | ||||||||||||||||||||
| 226 | # context => '#stay' | ||||||||||||||||||||
| 227 | # type => 'DetectChar' | ||||||||||||||||||||
| 228 | 414 | ▶ | if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 229 | 4 | return 1 | |||||||||||||||||||
| 230 | } | ||||||||||||||||||||
| 231 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 232 | # char => '}' | ||||||||||||||||||||
| 233 | # context => '#stay' | ||||||||||||||||||||
| 234 | # endRegion => 'Brace' | ||||||||||||||||||||
| 235 | # type => 'DetectChar' | ||||||||||||||||||||
| 236 | 410 | ▶ | if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 237 | 4 | return 1 | |||||||||||||||||||
| 238 | } | ||||||||||||||||||||
| 239 | # attribute => 'String' | ||||||||||||||||||||
| 240 | # char => '"' | ||||||||||||||||||||
| 241 | # context => 'String' | ||||||||||||||||||||
| 242 | # type => 'DetectChar' | ||||||||||||||||||||
| 243 | 406 | ▶ | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 244 | 24 | return 1 | |||||||||||||||||||
| 245 | } | ||||||||||||||||||||
| 246 | # attribute => 'Comment' | ||||||||||||||||||||
| 247 | # char => '/' | ||||||||||||||||||||
| 248 | # char1 => '/' | ||||||||||||||||||||
| 249 | # context => 'Line Comment' | ||||||||||||||||||||
| 250 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 251 | 382 | ▶ | if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Line Comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 252 | 2 | return 1 | |||||||||||||||||||
| 253 | } | ||||||||||||||||||||
| 254 | # attribute => 'Comment' | ||||||||||||||||||||
| 255 | # char => '#' | ||||||||||||||||||||
| 256 | # char1 => '!' | ||||||||||||||||||||
| 257 | # context => 'Line Comment' | ||||||||||||||||||||
| 258 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 259 | 380 | ▶ | if ($self->testDetect2Chars($text, '#', '!', 0, 0, 0, undef, 0, 'Line Comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 260 | 2 | return 1 | |||||||||||||||||||
| 261 | } | ||||||||||||||||||||
| 262 | # attribute => 'Comment' | ||||||||||||||||||||
| 263 | # beginRegion => 'Comment' | ||||||||||||||||||||
| 264 | # char => '/' | ||||||||||||||||||||
| 265 | # char1 => '*' | ||||||||||||||||||||
| 266 | # context => 'Block Comment' | ||||||||||||||||||||
| 267 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 268 | 378 | ▶ | if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Block Comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 269 | 2 | return 1 | |||||||||||||||||||
| 270 | } | ||||||||||||||||||||
| 271 | # String => '#\s*if\s+0' | ||||||||||||||||||||
| 272 | # attribute => 'Preprocessor' | ||||||||||||||||||||
| 273 | # beginRegion => 'Outscoped' | ||||||||||||||||||||
| 274 | # context => 'Outscoped' | ||||||||||||||||||||
| 275 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 276 | # type => 'RegExpr' | ||||||||||||||||||||
| 277 | 376 | ▶ | if ($self->testRegExpr($text, '#\\s*if\\s+0', 0, 0, 0, undef, 1, 'Outscoped', 'Preprocessor')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 278 | 0 | return 1 | |||||||||||||||||||
| 279 | } | ||||||||||||||||||||
| 280 | # attribute => 'Preprocessor' | ||||||||||||||||||||
| 281 | # char => '#' | ||||||||||||||||||||
| 282 | # context => 'Preprocessor' | ||||||||||||||||||||
| 283 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 284 | # type => 'DetectChar' | ||||||||||||||||||||
| 285 | 376 | ▶ | if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Preprocessor', 'Preprocessor')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 286 | 2 | return 1 | |||||||||||||||||||
| 287 | } | ||||||||||||||||||||
| 288 | 374 | return 0; | |||||||||||||||||||
| 289 | }; | ||||||||||||||||||||
| 290 | |||||||||||||||||||||
| 291 | 0 | ▶ | sub parseOutscoped { | ||||||||||||||||||
|
Subroutine
parseOutscoped: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||
| 292 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 293 | # String => '(FIXME|TODO|NOT(IC)?E):?' | ||||||||||||||||||||
| 294 | # attribute => 'Note' | ||||||||||||||||||||
| 295 | # context => '#stay' | ||||||||||||||||||||
| 296 | # type => 'RegExpr' | ||||||||||||||||||||
| 297 | 0 | ▶ | if ($self->testRegExpr($text, '(FIXME|TODO|NOT(IC)?E):?', 0, 0, 0, undef, 0, '#stay', 'Note')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 298 | 0 | return 1 | |||||||||||||||||||
| 299 | } | ||||||||||||||||||||
| 300 | # attribute => 'Comment' | ||||||||||||||||||||
| 301 | # beginRegion => 'Comment' | ||||||||||||||||||||
| 302 | # char => '/' | ||||||||||||||||||||
| 303 | # char1 => '*' | ||||||||||||||||||||
| 304 | # context => 'Block Comment' | ||||||||||||||||||||
| 305 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 306 | 0 | ▶ | if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Block Comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 307 | 0 | return 1 | |||||||||||||||||||
| 308 | } | ||||||||||||||||||||
| 309 | # String => '#\s*if' | ||||||||||||||||||||
| 310 | # attribute => 'Comment' | ||||||||||||||||||||
| 311 | # beginRegion => 'Outscoped' | ||||||||||||||||||||
| 312 | # context => 'Outscoped intern' | ||||||||||||||||||||
| 313 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 314 | # type => 'RegExpr' | ||||||||||||||||||||
| 315 | 0 | ▶ | if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 316 | 0 | return 1 | |||||||||||||||||||
| 317 | } | ||||||||||||||||||||
| 318 | # String => '#\s*(endif|elif|else)' | ||||||||||||||||||||
| 319 | # attribute => 'Preprocessor' | ||||||||||||||||||||
| 320 | # context => '#pop' | ||||||||||||||||||||
| 321 | # endRegion => 'Outscoped' | ||||||||||||||||||||
| 322 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 323 | # type => 'RegExpr' | ||||||||||||||||||||
| 324 | 0 | ▶ | if ($self->testRegExpr($text, '#\\s*(endif|elif|else)', 0, 0, 0, undef, 1, '#pop', 'Preprocessor')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 325 | 0 | return 1 | |||||||||||||||||||
| 326 | } | ||||||||||||||||||||
| 327 | 0 | return 0; | |||||||||||||||||||
| 328 | }; | ||||||||||||||||||||
| 329 | |||||||||||||||||||||
| 330 | 0 | ▶ | sub parseOutscopedintern { | ||||||||||||||||||
|
Subroutine
parseOutscopedintern: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||
| 331 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 332 | # attribute => 'Comment' | ||||||||||||||||||||
| 333 | # beginRegion => 'Comment' | ||||||||||||||||||||
| 334 | # char => '/' | ||||||||||||||||||||
| 335 | # char1 => '*' | ||||||||||||||||||||
| 336 | # context => 'Block Comment' | ||||||||||||||||||||
| 337 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 338 | 0 | ▶ | if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Block Comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 339 | 0 | return 1 | |||||||||||||||||||
| 340 | } | ||||||||||||||||||||
| 341 | # String => '#\s*if' | ||||||||||||||||||||
| 342 | # attribute => 'Comment' | ||||||||||||||||||||
| 343 | # beginRegion => 'Outscoped' | ||||||||||||||||||||
| 344 | # context => 'Outscoped intern' | ||||||||||||||||||||
| 345 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 346 | # type => 'RegExpr' | ||||||||||||||||||||
| 347 | 0 | ▶ | if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 348 | 0 | return 1 | |||||||||||||||||||
| 349 | } | ||||||||||||||||||||
| 350 | # String => '#\s*endif' | ||||||||||||||||||||
| 351 | # attribute => 'Comment' | ||||||||||||||||||||
| 352 | # context => '#pop' | ||||||||||||||||||||
| 353 | # endRegion => 'Outscoped' | ||||||||||||||||||||
| 354 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 355 | # type => 'RegExpr' | ||||||||||||||||||||
| 356 | 0 | ▶ | if ($self->testRegExpr($text, '#\\s*endif', 0, 0, 0, undef, 1, '#pop', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 357 | 0 | return 1 | |||||||||||||||||||
| 358 | } | ||||||||||||||||||||
| 359 | 0 | return 0; | |||||||||||||||||||
| 360 | }; | ||||||||||||||||||||
| 361 | |||||||||||||||||||||
| 362 | 56 | ▶ | sub parsePreprocessor { | ||||||||||||||||||
|
Subroutine
parsePreprocessor: called CC=6 SCAR=19.1
Pod
undocumented
| |||||||||||||||||||||
| 363 | 56 | my ($self, $text) = @_; | |||||||||||||||||||
| 364 | # attribute => 'Preprocessor Lib' | ||||||||||||||||||||
| 365 | # char => '"' | ||||||||||||||||||||
| 366 | # char1 => '"' | ||||||||||||||||||||
| 367 | # context => '#stay' | ||||||||||||||||||||
| 368 | # type => 'RangeDetect' | ||||||||||||||||||||
| 369 | 56 | ▶ | if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Preprocessor Lib')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 370 | 2 | return 1 | |||||||||||||||||||
| 371 | } | ||||||||||||||||||||
| 372 | # attribute => 'Preprocessor Lib' | ||||||||||||||||||||
| 373 | # char => '<' | ||||||||||||||||||||
| 374 | # char1 => '>' | ||||||||||||||||||||
| 375 | # context => '#stay' | ||||||||||||||||||||
| 376 | # type => 'RangeDetect' | ||||||||||||||||||||
| 377 | 54 | ▶ | if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Preprocessor Lib')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 378 | 0 | return 1 | |||||||||||||||||||
| 379 | } | ||||||||||||||||||||
| 380 | # attribute => 'Comment' | ||||||||||||||||||||
| 381 | # char => '/' | ||||||||||||||||||||
| 382 | # char1 => '/' | ||||||||||||||||||||
| 383 | # context => 'Line Comment' | ||||||||||||||||||||
| 384 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 385 | 54 | ▶ | if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Line Comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 386 | 0 | return 1 | |||||||||||||||||||
| 387 | } | ||||||||||||||||||||
| 388 | # attribute => 'Comment' | ||||||||||||||||||||
| 389 | # char => '/' | ||||||||||||||||||||
| 390 | # char1 => '*' | ||||||||||||||||||||
| 391 | # context => 'Block Comment' | ||||||||||||||||||||
| 392 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 393 | 54 | ▶ | if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Block Comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 394 | 2 | return 1 | |||||||||||||||||||
| 395 | } | ||||||||||||||||||||
| 396 | # attribute => 'Preprocessor' | ||||||||||||||||||||
| 397 | # context => '#stay' | ||||||||||||||||||||
| 398 | # type => 'LineContinue' | ||||||||||||||||||||
| 399 | 52 | ▶ | if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 400 | 0 | return 1 | |||||||||||||||||||
| 401 | } | ||||||||||||||||||||
| 402 | 52 | return 0; | |||||||||||||||||||
| 403 | }; | ||||||||||||||||||||
| 404 | |||||||||||||||||||||
| 405 | 180 | ▶ | sub parseString { | ||||||||||||||||||
|
Subroutine
parseString: called CC=5 SCAR=16.6
Pod
undocumented
| |||||||||||||||||||||
| 406 | 180 | my ($self, $text) = @_; | |||||||||||||||||||
| 407 | # String => '\\d[0-9]+' | ||||||||||||||||||||
| 408 | # attribute => 'String Char' | ||||||||||||||||||||
| 409 | # context => '#stay' | ||||||||||||||||||||
| 410 | # type => 'RegExpr' | ||||||||||||||||||||
| 411 | 180 | ▶ | if ($self->testRegExpr($text, '\\\\d[0-9]+', 0, 0, 0, undef, 0, '#stay', 'String Char')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 412 | 0 | return 1 | |||||||||||||||||||
| 413 | } | ||||||||||||||||||||
| 414 | # attribute => 'String Char' | ||||||||||||||||||||
| 415 | # context => '#stay' | ||||||||||||||||||||
| 416 | # type => 'HlCStringChar' | ||||||||||||||||||||
| 417 | 180 | ▶ | if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 418 | 12 | return 1 | |||||||||||||||||||
| 419 | } | ||||||||||||||||||||
| 420 | # attribute => 'String' | ||||||||||||||||||||
| 421 | # char => '"' | ||||||||||||||||||||
| 422 | # context => '#pop' | ||||||||||||||||||||
| 423 | # type => 'DetectChar' | ||||||||||||||||||||
| 424 | 168 | ▶ | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 425 | 24 | return 1 | |||||||||||||||||||
| 426 | } | ||||||||||||||||||||
| 427 | # attribute => 'String' | ||||||||||||||||||||
| 428 | # context => '#stay' | ||||||||||||||||||||
| 429 | # type => 'LineContinue' | ||||||||||||||||||||
| 430 | 144 | ▶ | if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 431 | 0 | return 1 | |||||||||||||||||||
| 432 | } | ||||||||||||||||||||
| 433 | 144 | return 0; | |||||||||||||||||||
| 434 | }; | ||||||||||||||||||||
| 435 | |||||||||||||||||||||
| 436 | |||||||||||||||||||||
| 437 | 1 | 1; | |||||||||||||||||||
| 438 | |||||||||||||||||||||
| 439 | __END__ | ||||||||||||||||||||