| 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 'lpc.xml' file of the syntax highlight | ||||||||||||||||||||
| 6 | # engine of the kate text editor (http://www.kate-editor.org | ||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | #kate xml version 0.76 | ||||||||||||||||||||
| 9 | #kate version 2.4 | ||||||||||||||||||||
| 10 | #kate author Andreas Klauer (Andreas.Klauer@metamorpher.de) | ||||||||||||||||||||
| 11 | #generated: Sun Feb 3 22:02:05 2008, localtime | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | package Syntax::Highlight::Engine::Kate::LPC; | ||||||||||||||||||||
| 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 | 'Alert' => 'Alert', | ||||||||||||||||||||
| 27 | 'Binary' => 'BaseN', | ||||||||||||||||||||
| 28 | 'Char' => 'Char', | ||||||||||||||||||||
| 29 | 'Closure' => 'Others', | ||||||||||||||||||||
| 30 | 'Datatype' => 'DataType', | ||||||||||||||||||||
| 31 | 'Default' => 'Normal', | ||||||||||||||||||||
| 32 | 'Floats' => 'Float', | ||||||||||||||||||||
| 33 | 'Hexadecimal' => 'BaseN', | ||||||||||||||||||||
| 34 | 'Integer' => 'DecVal', | ||||||||||||||||||||
| 35 | 'Keywords' => 'Keyword', | ||||||||||||||||||||
| 36 | 'Modifier' => 'DataType', | ||||||||||||||||||||
| 37 | 'Multi-Line comments' => 'Comment', | ||||||||||||||||||||
| 38 | 'Octal' => 'BaseN', | ||||||||||||||||||||
| 39 | 'Preprocessor' => 'Others', | ||||||||||||||||||||
| 40 | 'Preprocessor-Strings' => 'String', | ||||||||||||||||||||
| 41 | 'Region Marker' => 'RegionMarker', | ||||||||||||||||||||
| 42 | 'Single-Line comments' => 'Comment', | ||||||||||||||||||||
| 43 | 'Strings' => 'String', | ||||||||||||||||||||
| 44 | }); | ||||||||||||||||||||
| 45 | 2 | $self->listAdd('attention', | |||||||||||||||||||
| 46 | '###', | ||||||||||||||||||||
| 47 | 'FIXME', | ||||||||||||||||||||
| 48 | 'HACK', | ||||||||||||||||||||
| 49 | 'NOTE', | ||||||||||||||||||||
| 50 | 'NOTICE', | ||||||||||||||||||||
| 51 | 'TODO', | ||||||||||||||||||||
| 52 | 'WARNING', | ||||||||||||||||||||
| 53 | ); | ||||||||||||||||||||
| 54 | 2 | $self->listAdd('keywords', | |||||||||||||||||||
| 55 | 'break', | ||||||||||||||||||||
| 56 | 'case', | ||||||||||||||||||||
| 57 | 'continue', | ||||||||||||||||||||
| 58 | 'default', | ||||||||||||||||||||
| 59 | 'do', | ||||||||||||||||||||
| 60 | 'else', | ||||||||||||||||||||
| 61 | 'for', | ||||||||||||||||||||
| 62 | 'foreach', | ||||||||||||||||||||
| 63 | 'functions', | ||||||||||||||||||||
| 64 | 'if', | ||||||||||||||||||||
| 65 | 'inherit', | ||||||||||||||||||||
| 66 | 'nolog', | ||||||||||||||||||||
| 67 | 'publish', | ||||||||||||||||||||
| 68 | 'return', | ||||||||||||||||||||
| 69 | 'switch', | ||||||||||||||||||||
| 70 | 'variables', | ||||||||||||||||||||
| 71 | 'while', | ||||||||||||||||||||
| 72 | ); | ||||||||||||||||||||
| 73 | 2 | $self->listAdd('modifiers', | |||||||||||||||||||
| 74 | 'nomask', | ||||||||||||||||||||
| 75 | 'nosave', | ||||||||||||||||||||
| 76 | 'private', | ||||||||||||||||||||
| 77 | 'protected', | ||||||||||||||||||||
| 78 | 'public', | ||||||||||||||||||||
| 79 | 'static', | ||||||||||||||||||||
| 80 | 'varargs', | ||||||||||||||||||||
| 81 | 'virtual', | ||||||||||||||||||||
| 82 | ); | ||||||||||||||||||||
| 83 | 2 | $self->listAdd('types', | |||||||||||||||||||
| 84 | 'array', | ||||||||||||||||||||
| 85 | 'closure', | ||||||||||||||||||||
| 86 | 'float', | ||||||||||||||||||||
| 87 | 'int', | ||||||||||||||||||||
| 88 | 'mapping', | ||||||||||||||||||||
| 89 | 'mixed', | ||||||||||||||||||||
| 90 | 'object', | ||||||||||||||||||||
| 91 | 'status', | ||||||||||||||||||||
| 92 | 'string', | ||||||||||||||||||||
| 93 | 'symbol', | ||||||||||||||||||||
| 94 | 'void', | ||||||||||||||||||||
| 95 | ); | ||||||||||||||||||||
| 96 | 2 | $self->contextdata({ | |||||||||||||||||||
| 97 | 'Comment1' => { | ||||||||||||||||||||
| 98 | callback => \&parseComment1, | ||||||||||||||||||||
| 99 | attribute => 'Single-Line comments', | ||||||||||||||||||||
| 100 | lineending => '#pop', | ||||||||||||||||||||
| 101 | }, | ||||||||||||||||||||
| 102 | 'Comment2' => { | ||||||||||||||||||||
| 103 | callback => \&parseComment2, | ||||||||||||||||||||
| 104 | attribute => 'Multi-Line comments', | ||||||||||||||||||||
| 105 | }, | ||||||||||||||||||||
| 106 | 'Normal' => { | ||||||||||||||||||||
| 107 | callback => \&parseNormal, | ||||||||||||||||||||
| 108 | attribute => 'Default', | ||||||||||||||||||||
| 109 | }, | ||||||||||||||||||||
| 110 | 'Preprocessor' => { | ||||||||||||||||||||
| 111 | callback => \&parsePreprocessor, | ||||||||||||||||||||
| 112 | attribute => 'Preprocessor', | ||||||||||||||||||||
| 113 | lineending => '#pop', | ||||||||||||||||||||
| 114 | }, | ||||||||||||||||||||
| 115 | 'String1' => { | ||||||||||||||||||||
| 116 | callback => \&parseString1, | ||||||||||||||||||||
| 117 | attribute => 'Strings', | ||||||||||||||||||||
| 118 | lineending => '#pop', | ||||||||||||||||||||
| 119 | }, | ||||||||||||||||||||
| 120 | 'String2' => { | ||||||||||||||||||||
| 121 | callback => \&parseString2, | ||||||||||||||||||||
| 122 | attribute => 'Preprocessor-Strings', | ||||||||||||||||||||
| 123 | lineending => '#pop', | ||||||||||||||||||||
| 124 | }, | ||||||||||||||||||||
| 125 | }); | ||||||||||||||||||||
| 126 | 2 | $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); | |||||||||||||||||||
| 127 | 2 | $self->basecontext('Normal'); | |||||||||||||||||||
| 128 | 2 | $self->keywordscase(0); | |||||||||||||||||||
| 129 | 2 | $self->initialize; | |||||||||||||||||||
| 130 | 2 | bless ($self, $class); | |||||||||||||||||||
| 131 | 2 | return $self; | |||||||||||||||||||
| 132 | } | ||||||||||||||||||||
| 133 | |||||||||||||||||||||
| 134 | 0 | ▶ | sub language { | ||||||||||||||||||
|
Subroutine
language: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 135 | 0 | return 'LPC'; | |||||||||||||||||||
| 136 | } | ||||||||||||||||||||
| 137 | |||||||||||||||||||||
| 138 | 1038 | ▶ | sub parseComment1 { | ||||||||||||||||||
|
Subroutine
parseComment1: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||
| 139 | 1038 | my ($self, $text) = @_; | |||||||||||||||||||
| 140 | # attribute => 'Single-Line comments' | ||||||||||||||||||||
| 141 | # context => '#stay' | ||||||||||||||||||||
| 142 | # type => 'LineContinue' | ||||||||||||||||||||
| 143 | 1038 | ▶ | if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Single-Line comments')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 144 | 4 | return 1 | |||||||||||||||||||
| 145 | } | ||||||||||||||||||||
| 146 | # String => 'attention' | ||||||||||||||||||||
| 147 | # attribute => 'Alert' | ||||||||||||||||||||
| 148 | # context => '#stay' | ||||||||||||||||||||
| 149 | # type => 'keyword' | ||||||||||||||||||||
| 150 | 1034 | ▶ | if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 151 | 2 | return 1 | |||||||||||||||||||
| 152 | } | ||||||||||||||||||||
| 153 | 1032 | return 0; | |||||||||||||||||||
| 154 | }; | ||||||||||||||||||||
| 155 | |||||||||||||||||||||
| 156 | 690 | ▶ | sub parseComment2 { | ||||||||||||||||||
|
Subroutine
parseComment2: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||
| 157 | 690 | my ($self, $text) = @_; | |||||||||||||||||||
| 158 | # attribute => 'Multi-Line comments' | ||||||||||||||||||||
| 159 | # char => '*' | ||||||||||||||||||||
| 160 | # char1 => '/' | ||||||||||||||||||||
| 161 | # context => '#pop' | ||||||||||||||||||||
| 162 | # endRegion => 'blockComment' | ||||||||||||||||||||
| 163 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 164 | 690 | ▶ | if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Multi-Line comments')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 165 | 8 | return 1 | |||||||||||||||||||
| 166 | } | ||||||||||||||||||||
| 167 | # String => 'attention' | ||||||||||||||||||||
| 168 | # attribute => 'Alert' | ||||||||||||||||||||
| 169 | # context => '#stay' | ||||||||||||||||||||
| 170 | # type => 'keyword' | ||||||||||||||||||||
| 171 | 682 | ▶ | if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 172 | 6 | return 1 | |||||||||||||||||||
| 173 | } | ||||||||||||||||||||
| 174 | 676 | return 0; | |||||||||||||||||||
| 175 | }; | ||||||||||||||||||||
| 176 | |||||||||||||||||||||
| 177 | 664 | ▶ | sub parseNormal { | ||||||||||||||||||
|
Subroutine
parseNormal: called CC=20 SCAR=31.6
Pod
undocumented
| |||||||||||||||||||||
| 178 | 664 | my ($self, $text) = @_; | |||||||||||||||||||
| 179 | # String => '//\s*BEGIN.*$' | ||||||||||||||||||||
| 180 | # attribute => 'Region Marker' | ||||||||||||||||||||
| 181 | # beginRegion => 'regionMarker' | ||||||||||||||||||||
| 182 | # context => '#stay' | ||||||||||||||||||||
| 183 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 184 | # type => 'RegExpr' | ||||||||||||||||||||
| 185 | 664 | ▶ | if ($self->testRegExpr($text, '//\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 186 | 0 | return 1 | |||||||||||||||||||
| 187 | } | ||||||||||||||||||||
| 188 | # String => '//\s*END.*$' | ||||||||||||||||||||
| 189 | # attribute => 'Region Marker' | ||||||||||||||||||||
| 190 | # context => '#stay' | ||||||||||||||||||||
| 191 | # endRegion => 'regionMarker' | ||||||||||||||||||||
| 192 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 193 | # type => 'RegExpr' | ||||||||||||||||||||
| 194 | 664 | ▶ | if ($self->testRegExpr($text, '//\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 195 | 0 | return 1 | |||||||||||||||||||
| 196 | } | ||||||||||||||||||||
| 197 | # attribute => 'Single-Line comments' | ||||||||||||||||||||
| 198 | # char => '/' | ||||||||||||||||||||
| 199 | # char1 => '/' | ||||||||||||||||||||
| 200 | # context => 'Comment1' | ||||||||||||||||||||
| 201 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 202 | 664 | ▶ | if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment1', 'Single-Line comments')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 203 | 30 | return 1 | |||||||||||||||||||
| 204 | } | ||||||||||||||||||||
| 205 | # attribute => 'Multi-Line comments' | ||||||||||||||||||||
| 206 | # beginRegion => 'blockComment' | ||||||||||||||||||||
| 207 | # char => '/' | ||||||||||||||||||||
| 208 | # char1 => '*' | ||||||||||||||||||||
| 209 | # context => 'Comment2' | ||||||||||||||||||||
| 210 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 211 | 634 | ▶ | if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Comment2', 'Multi-Line comments')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 212 | 8 | return 1 | |||||||||||||||||||
| 213 | } | ||||||||||||||||||||
| 214 | # String => 'modifiers' | ||||||||||||||||||||
| 215 | # attribute => 'Modifier' | ||||||||||||||||||||
| 216 | # context => '#stay' | ||||||||||||||||||||
| 217 | # type => 'keyword' | ||||||||||||||||||||
| 218 | 626 | ▶ | if ($self->testKeyword($text, 'modifiers', 0, undef, 0, '#stay', 'Modifier')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 219 | 2 | return 1 | |||||||||||||||||||
| 220 | } | ||||||||||||||||||||
| 221 | # String => 'types' | ||||||||||||||||||||
| 222 | # attribute => 'Datatype' | ||||||||||||||||||||
| 223 | # context => '#stay' | ||||||||||||||||||||
| 224 | # type => 'keyword' | ||||||||||||||||||||
| 225 | 624 | ▶ | if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Datatype')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 226 | 16 | return 1 | |||||||||||||||||||
| 227 | } | ||||||||||||||||||||
| 228 | # String => 'keywords' | ||||||||||||||||||||
| 229 | # attribute => 'Keywords' | ||||||||||||||||||||
| 230 | # context => '#stay' | ||||||||||||||||||||
| 231 | # type => 'keyword' | ||||||||||||||||||||
| 232 | 608 | ▶ | if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keywords')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 233 | 12 | return 1 | |||||||||||||||||||
| 234 | } | ||||||||||||||||||||
| 235 | # attribute => 'Preprocessor' | ||||||||||||||||||||
| 236 | # char => '#' | ||||||||||||||||||||
| 237 | # column => '0' | ||||||||||||||||||||
| 238 | # context => 'Preprocessor' | ||||||||||||||||||||
| 239 | # type => 'DetectChar' | ||||||||||||||||||||
| 240 | 596 | ▶ | if ($self->testDetectChar($text, '#', 0, 0, 0, 0, 0, 'Preprocessor', 'Preprocessor')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 241 | 2 | return 1 | |||||||||||||||||||
| 242 | } | ||||||||||||||||||||
| 243 | # attribute => 'Floats' | ||||||||||||||||||||
| 244 | # context => '#stay' | ||||||||||||||||||||
| 245 | # items => 'ARRAY(0x19c5720)' | ||||||||||||||||||||
| 246 | # type => 'Float' | ||||||||||||||||||||
| 247 | 594 | ▶ | if ($self->testFloat($text, 0, undef, 0, '#stay', 'Floats')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 248 | # String => 'fFeE' | ||||||||||||||||||||
| 249 | # context => '#stay' | ||||||||||||||||||||
| 250 | # type => 'AnyChar' | ||||||||||||||||||||
| 251 | 20 | ▶ | if ($self->testAnyChar($text, 'fFeE', 0, 0, undef, 0, '#stay', undef)) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 252 | 0 | return 1 | |||||||||||||||||||
| 253 | } | ||||||||||||||||||||
| 254 | } | ||||||||||||||||||||
| 255 | # String => '0b[01]+' | ||||||||||||||||||||
| 256 | # attribute => 'Binary' | ||||||||||||||||||||
| 257 | # context => '#stay' | ||||||||||||||||||||
| 258 | # type => 'RegExpr' | ||||||||||||||||||||
| 259 | 594 | ▶ | if ($self->testRegExpr($text, '0b[01]+', 0, 0, 0, undef, 0, '#stay', 'Binary')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 260 | 0 | return 1 | |||||||||||||||||||
| 261 | } | ||||||||||||||||||||
| 262 | # String => '0x[0-9a-fA-F]+' | ||||||||||||||||||||
| 263 | # attribute => 'Hexadecimal' | ||||||||||||||||||||
| 264 | # context => '#stay' | ||||||||||||||||||||
| 265 | # type => 'RegExpr' | ||||||||||||||||||||
| 266 | 594 | ▶ | if ($self->testRegExpr($text, '0x[0-9a-fA-F]+', 0, 0, 0, undef, 0, '#stay', 'Hexadecimal')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 267 | 0 | return 1 | |||||||||||||||||||
| 268 | } | ||||||||||||||||||||
| 269 | # String => '0o[0-7]+' | ||||||||||||||||||||
| 270 | # attribute => 'Octal' | ||||||||||||||||||||
| 271 | # context => '#stay' | ||||||||||||||||||||
| 272 | # type => 'RegExpr' | ||||||||||||||||||||
| 273 | 594 | ▶ | if ($self->testRegExpr($text, '0o[0-7]+', 0, 0, 0, undef, 0, '#stay', 'Octal')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 274 | 0 | return 1 | |||||||||||||||||||
| 275 | } | ||||||||||||||||||||
| 276 | # attribute => 'Integer' | ||||||||||||||||||||
| 277 | # context => '#stay' | ||||||||||||||||||||
| 278 | # type => 'Int' | ||||||||||||||||||||
| 279 | 594 | ▶ | if ($self->testInt($text, 0, undef, 0, '#stay', 'Integer')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 280 | 0 | return 1 | |||||||||||||||||||
| 281 | } | ||||||||||||||||||||
| 282 | # String => '#'[^\t ][^\t ,);}\]/]*' | ||||||||||||||||||||
| 283 | # attribute => 'Closure' | ||||||||||||||||||||
| 284 | # context => '#stay' | ||||||||||||||||||||
| 285 | # type => 'RegExpr' | ||||||||||||||||||||
| 286 | 594 | ▶ | if ($self->testRegExpr($text, '#\'[^\\t ][^\\t ,);}\\]/]*', 0, 0, 0, undef, 0, '#stay', 'Closure')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 287 | 4 | return 1 | |||||||||||||||||||
| 288 | } | ||||||||||||||||||||
| 289 | # attribute => 'Strings' | ||||||||||||||||||||
| 290 | # char => '"' | ||||||||||||||||||||
| 291 | # context => 'String1' | ||||||||||||||||||||
| 292 | # type => 'DetectChar' | ||||||||||||||||||||
| 293 | 590 | ▶ | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String1', 'Strings')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 294 | 4 | return 1 | |||||||||||||||||||
| 295 | } | ||||||||||||||||||||
| 296 | # attribute => 'Char' | ||||||||||||||||||||
| 297 | # context => '#stay' | ||||||||||||||||||||
| 298 | # type => 'HlCStringChar' | ||||||||||||||||||||
| 299 | 586 | ▶ | if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'Char')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 300 | 0 | return 1 | |||||||||||||||||||
| 301 | } | ||||||||||||||||||||
| 302 | # attribute => 'Default' | ||||||||||||||||||||
| 303 | # beginRegion => 'brace' | ||||||||||||||||||||
| 304 | # char => '{' | ||||||||||||||||||||
| 305 | # context => '#stay' | ||||||||||||||||||||
| 306 | # type => 'DetectChar' | ||||||||||||||||||||
| 307 | 586 | ▶ | if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Default')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 308 | 8 | return 1 | |||||||||||||||||||
| 309 | } | ||||||||||||||||||||
| 310 | # attribute => 'Default' | ||||||||||||||||||||
| 311 | # char => '}' | ||||||||||||||||||||
| 312 | # context => '#stay' | ||||||||||||||||||||
| 313 | # endRegion => 'brace' | ||||||||||||||||||||
| 314 | # type => 'DetectChar' | ||||||||||||||||||||
| 315 | 578 | ▶ | if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Default')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 316 | 8 | return 1 | |||||||||||||||||||
| 317 | } | ||||||||||||||||||||
| 318 | 570 | return 0; | |||||||||||||||||||
| 319 | }; | ||||||||||||||||||||
| 320 | |||||||||||||||||||||
| 321 | 210 | ▶ | sub parsePreprocessor { | ||||||||||||||||||
|
Subroutine
parsePreprocessor: called CC=8 SCAR=21.4
Pod
undocumented
| |||||||||||||||||||||
| 322 | 210 | my ($self, $text) = @_; | |||||||||||||||||||
| 323 | # attribute => 'Preprocessor' | ||||||||||||||||||||
| 324 | # context => '#stay' | ||||||||||||||||||||
| 325 | # type => 'LineContinue' | ||||||||||||||||||||
| 326 | 210 | ▶ | if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 327 | 6 | return 1 | |||||||||||||||||||
| 328 | } | ||||||||||||||||||||
| 329 | # attribute => 'Single-Line comments' | ||||||||||||||||||||
| 330 | # char => '/' | ||||||||||||||||||||
| 331 | # char1 => '/' | ||||||||||||||||||||
| 332 | # context => 'Comment1' | ||||||||||||||||||||
| 333 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 334 | 204 | ▶ | if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment1', 'Single-Line comments')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 335 | 2 | return 1 | |||||||||||||||||||
| 336 | } | ||||||||||||||||||||
| 337 | # attribute => 'Multi-Line comments' | ||||||||||||||||||||
| 338 | # beginRegion => 'blockComment' | ||||||||||||||||||||
| 339 | # char => '/' | ||||||||||||||||||||
| 340 | # char1 => '*' | ||||||||||||||||||||
| 341 | # context => 'Comment2' | ||||||||||||||||||||
| 342 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 343 | 202 | ▶ | if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Comment2', 'Multi-Line comments')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 344 | 0 | return 1 | |||||||||||||||||||
| 345 | } | ||||||||||||||||||||
| 346 | # String => 'modifiers' | ||||||||||||||||||||
| 347 | # attribute => 'Modifier' | ||||||||||||||||||||
| 348 | # context => '#stay' | ||||||||||||||||||||
| 349 | # type => 'keyword' | ||||||||||||||||||||
| 350 | 202 | ▶ | if ($self->testKeyword($text, 'modifiers', 0, undef, 0, '#stay', 'Modifier')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 351 | 0 | return 1 | |||||||||||||||||||
| 352 | } | ||||||||||||||||||||
| 353 | # String => 'types' | ||||||||||||||||||||
| 354 | # attribute => 'Datatype' | ||||||||||||||||||||
| 355 | # context => '#stay' | ||||||||||||||||||||
| 356 | # type => 'keyword' | ||||||||||||||||||||
| 357 | 202 | ▶ | if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Datatype')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 358 | 0 | return 1 | |||||||||||||||||||
| 359 | } | ||||||||||||||||||||
| 360 | # String => 'keywords' | ||||||||||||||||||||
| 361 | # attribute => 'Keywords' | ||||||||||||||||||||
| 362 | # context => '#stay' | ||||||||||||||||||||
| 363 | # type => 'keyword' | ||||||||||||||||||||
| 364 | 202 | ▶ | if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keywords')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 365 | 2 | return 1 | |||||||||||||||||||
| 366 | } | ||||||||||||||||||||
| 367 | # attribute => 'Preprocessor-Strings' | ||||||||||||||||||||
| 368 | # char => '"' | ||||||||||||||||||||
| 369 | # context => 'String2' | ||||||||||||||||||||
| 370 | # type => 'DetectChar' | ||||||||||||||||||||
| 371 | 200 | ▶ | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String2', 'Preprocessor-Strings')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 372 | 4 | return 1 | |||||||||||||||||||
| 373 | } | ||||||||||||||||||||
| 374 | 196 | return 0; | |||||||||||||||||||
| 375 | }; | ||||||||||||||||||||
| 376 | |||||||||||||||||||||
| 377 | 44 | ▶ | sub parseString1 { | ||||||||||||||||||
|
Subroutine
parseString1: called CC=5 SCAR=16.6
Pod
undocumented
| |||||||||||||||||||||
| 378 | 44 | my ($self, $text) = @_; | |||||||||||||||||||
| 379 | # attribute => 'Default' | ||||||||||||||||||||
| 380 | # context => '#stay' | ||||||||||||||||||||
| 381 | # type => 'LineContinue' | ||||||||||||||||||||
| 382 | 44 | ▶ | if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Default')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 383 | 2 | return 1 | |||||||||||||||||||
| 384 | } | ||||||||||||||||||||
| 385 | # attribute => 'Strings' | ||||||||||||||||||||
| 386 | # char => '\' | ||||||||||||||||||||
| 387 | # char1 => '\' | ||||||||||||||||||||
| 388 | # context => '#stay' | ||||||||||||||||||||
| 389 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 390 | 42 | ▶ | if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'Strings')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 391 | 0 | return 1 | |||||||||||||||||||
| 392 | } | ||||||||||||||||||||
| 393 | # attribute => 'Strings' | ||||||||||||||||||||
| 394 | # char => '\' | ||||||||||||||||||||
| 395 | # char1 => '"' | ||||||||||||||||||||
| 396 | # context => '#stay' | ||||||||||||||||||||
| 397 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 398 | 42 | ▶ | if ($self->testDetect2Chars($text, '\\', '"', 0, 0, 0, undef, 0, '#stay', 'Strings')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 399 | 0 | return 1 | |||||||||||||||||||
| 400 | } | ||||||||||||||||||||
| 401 | # attribute => 'Strings' | ||||||||||||||||||||
| 402 | # char => '"' | ||||||||||||||||||||
| 403 | # context => '#pop' | ||||||||||||||||||||
| 404 | # type => 'DetectChar' | ||||||||||||||||||||
| 405 | 42 | ▶ | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Strings')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 406 | 4 | return 1 | |||||||||||||||||||
| 407 | } | ||||||||||||||||||||
| 408 | 38 | return 0; | |||||||||||||||||||
| 409 | }; | ||||||||||||||||||||
| 410 | |||||||||||||||||||||
| 411 | 16 | ▶ | sub parseString2 { | ||||||||||||||||||
|
Subroutine
parseString2: called CC=5 SCAR=17.8
Pod
undocumented
| |||||||||||||||||||||
| 412 | 16 | my ($self, $text) = @_; | |||||||||||||||||||
| 413 | # attribute => 'Default' | ||||||||||||||||||||
| 414 | # context => '#stay' | ||||||||||||||||||||
| 415 | # type => 'LineContinue' | ||||||||||||||||||||
| 416 | 16 | ▶ | if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Default')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 417 | 0 | return 1 | |||||||||||||||||||
| 418 | } | ||||||||||||||||||||
| 419 | # attribute => 'Preprocessor-Strings' | ||||||||||||||||||||
| 420 | # char => '\' | ||||||||||||||||||||
| 421 | # char1 => '\' | ||||||||||||||||||||
| 422 | # context => '#stay' | ||||||||||||||||||||
| 423 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 424 | 16 | ▶ | if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'Preprocessor-Strings')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 425 | 0 | return 1 | |||||||||||||||||||
| 426 | } | ||||||||||||||||||||
| 427 | # attribute => 'Preprocessor-Strings' | ||||||||||||||||||||
| 428 | # char => '\' | ||||||||||||||||||||
| 429 | # char1 => '"' | ||||||||||||||||||||
| 430 | # context => '#stay' | ||||||||||||||||||||
| 431 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 432 | 16 | ▶ | if ($self->testDetect2Chars($text, '\\', '"', 0, 0, 0, undef, 0, '#stay', 'Preprocessor-Strings')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 433 | 0 | return 1 | |||||||||||||||||||
| 434 | } | ||||||||||||||||||||
| 435 | # attribute => 'Preprocessor-Strings' | ||||||||||||||||||||
| 436 | # char => '"' | ||||||||||||||||||||
| 437 | # context => '#pop' | ||||||||||||||||||||
| 438 | # type => 'DetectChar' | ||||||||||||||||||||
| 439 | 16 | ▶ | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Preprocessor-Strings')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 440 | 4 | return 1 | |||||||||||||||||||
| 441 | } | ||||||||||||||||||||
| 442 | 12 | return 0; | |||||||||||||||||||
| 443 | }; | ||||||||||||||||||||
| 444 | |||||||||||||||||||||
| 445 | |||||||||||||||||||||
| 446 | 1 | 1; | |||||||||||||||||||
| 447 | |||||||||||||||||||||
| 448 | __END__ | ||||||||||||||||||||