| 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 'ansic89.xml' file of the syntax highlight | ||||||||||||||||||||
| 6 | # engine of the kate text editor (http://www.kate-editor.org | ||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | #kate xml version 1.09 | ||||||||||||||||||||
| 9 | #kate version 2.4 | ||||||||||||||||||||
| 10 | #kate author Dominik Haumann (dhdev@gmx.de) | ||||||||||||||||||||
| 11 | #generated: Sun Feb 3 22:02:04 2008, localtime | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | package Syntax::Highlight::Engine::Kate::ANSI_C89; | ||||||||||||||||||||
| 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 | 1 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||
| 22 | 1 | my $proto = shift; | |||||||||||||||||||
| 23 | 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
| |||||||||||||||||||||
| 24 | 1 | my $self = $class->SUPER::new(@_); | |||||||||||||||||||
| 25 | 1 | $self->attributes({ | |||||||||||||||||||
| 26 | 'Char' => 'Char', | ||||||||||||||||||||
| 27 | 'Comment' => 'Comment', | ||||||||||||||||||||
| 28 | 'Data Type' => 'DataType', | ||||||||||||||||||||
| 29 | 'Decimal' => 'DecVal', | ||||||||||||||||||||
| 30 | 'Float' => 'Float', | ||||||||||||||||||||
| 31 | 'Hex' => 'BaseN', | ||||||||||||||||||||
| 32 | 'Keyword' => 'Keyword', | ||||||||||||||||||||
| 33 | 'Normal Text' => 'Normal', | ||||||||||||||||||||
| 34 | 'Octal' => 'BaseN', | ||||||||||||||||||||
| 35 | 'Prep. Lib' => 'Others', | ||||||||||||||||||||
| 36 | 'Preprocessor' => 'Others', | ||||||||||||||||||||
| 37 | 'String' => 'String', | ||||||||||||||||||||
| 38 | 'String Char' => 'Char', | ||||||||||||||||||||
| 39 | 'Symbol' => 'Normal', | ||||||||||||||||||||
| 40 | }); | ||||||||||||||||||||
| 41 | 1 | $self->listAdd('keywords', | |||||||||||||||||||
| 42 | 'break', | ||||||||||||||||||||
| 43 | 'case', | ||||||||||||||||||||
| 44 | 'continue', | ||||||||||||||||||||
| 45 | 'default', | ||||||||||||||||||||
| 46 | 'do', | ||||||||||||||||||||
| 47 | 'else', | ||||||||||||||||||||
| 48 | 'enum', | ||||||||||||||||||||
| 49 | 'extern', | ||||||||||||||||||||
| 50 | 'for', | ||||||||||||||||||||
| 51 | 'goto', | ||||||||||||||||||||
| 52 | 'if', | ||||||||||||||||||||
| 53 | 'return', | ||||||||||||||||||||
| 54 | 'sizeof', | ||||||||||||||||||||
| 55 | 'struct', | ||||||||||||||||||||
| 56 | 'switch', | ||||||||||||||||||||
| 57 | 'typedef', | ||||||||||||||||||||
| 58 | 'union', | ||||||||||||||||||||
| 59 | 'while', | ||||||||||||||||||||
| 60 | ); | ||||||||||||||||||||
| 61 | 1 | $self->listAdd('types', | |||||||||||||||||||
| 62 | 'auto', | ||||||||||||||||||||
| 63 | 'char', | ||||||||||||||||||||
| 64 | 'const', | ||||||||||||||||||||
| 65 | 'double', | ||||||||||||||||||||
| 66 | 'float', | ||||||||||||||||||||
| 67 | 'int', | ||||||||||||||||||||
| 68 | 'long', | ||||||||||||||||||||
| 69 | 'register', | ||||||||||||||||||||
| 70 | 'short', | ||||||||||||||||||||
| 71 | 'signed', | ||||||||||||||||||||
| 72 | 'static', | ||||||||||||||||||||
| 73 | 'unsigned', | ||||||||||||||||||||
| 74 | 'void', | ||||||||||||||||||||
| 75 | 'volatile', | ||||||||||||||||||||
| 76 | ); | ||||||||||||||||||||
| 77 | 1 | $self->contextdata({ | |||||||||||||||||||
| 78 | 'Define' => { | ||||||||||||||||||||
| 79 | callback => \&parseDefine, | ||||||||||||||||||||
| 80 | attribute => 'Preprocessor', | ||||||||||||||||||||
| 81 | lineending => '#pop', | ||||||||||||||||||||
| 82 | }, | ||||||||||||||||||||
| 83 | 'Normal' => { | ||||||||||||||||||||
| 84 | callback => \&parseNormal, | ||||||||||||||||||||
| 85 | attribute => 'Normal Text', | ||||||||||||||||||||
| 86 | }, | ||||||||||||||||||||
| 87 | 'Outscoped' => { | ||||||||||||||||||||
| 88 | callback => \&parseOutscoped, | ||||||||||||||||||||
| 89 | attribute => 'Comment', | ||||||||||||||||||||
| 90 | }, | ||||||||||||||||||||
| 91 | 'Outscoped intern' => { | ||||||||||||||||||||
| 92 | callback => \&parseOutscopedintern, | ||||||||||||||||||||
| 93 | attribute => 'Comment', | ||||||||||||||||||||
| 94 | }, | ||||||||||||||||||||
| 95 | 'Preprocessor' => { | ||||||||||||||||||||
| 96 | callback => \&parsePreprocessor, | ||||||||||||||||||||
| 97 | attribute => 'Preprocessor', | ||||||||||||||||||||
| 98 | lineending => '#pop', | ||||||||||||||||||||
| 99 | }, | ||||||||||||||||||||
| 100 | 'String' => { | ||||||||||||||||||||
| 101 | callback => \&parseString, | ||||||||||||||||||||
| 102 | attribute => 'String', | ||||||||||||||||||||
| 103 | lineending => '#pop', | ||||||||||||||||||||
| 104 | }, | ||||||||||||||||||||
| 105 | 'comment' => { | ||||||||||||||||||||
| 106 | callback => \&parsecomment, | ||||||||||||||||||||
| 107 | attribute => 'Comment', | ||||||||||||||||||||
| 108 | }, | ||||||||||||||||||||
| 109 | }); | ||||||||||||||||||||
| 110 | 1 | $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); | |||||||||||||||||||
| 111 | 1 | $self->basecontext('Normal'); | |||||||||||||||||||
| 112 | 1 | $self->keywordscase(0); | |||||||||||||||||||
| 113 | 1 | $self->initialize; | |||||||||||||||||||
| 114 | 1 | bless ($self, $class); | |||||||||||||||||||
| 115 | 1 | return $self; | |||||||||||||||||||
| 116 | } | ||||||||||||||||||||
| 117 | |||||||||||||||||||||
| 118 | 0 | ▶ | sub language { | ||||||||||||||||||
|
Subroutine
language: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 119 | 0 | return 'ANSI C89'; | |||||||||||||||||||
| 120 | } | ||||||||||||||||||||
| 121 | |||||||||||||||||||||
| 122 | 0 | ▶ | sub parseDefine { | ||||||||||||||||||
|
Subroutine
parseDefine: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 123 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 124 | # attribute => 'Preprocessor' | ||||||||||||||||||||
| 125 | # context => '#stay' | ||||||||||||||||||||
| 126 | # type => 'LineContinue' | ||||||||||||||||||||
| 127 | 0 | ▶ | if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 128 | 0 | return 1 | |||||||||||||||||||
| 129 | } | ||||||||||||||||||||
| 130 | 0 | return 0; | |||||||||||||||||||
| 131 | }; | ||||||||||||||||||||
| 132 | |||||||||||||||||||||
| 133 | 0 | ▶ | sub parseNormal { | ||||||||||||||||||
|
Subroutine
parseNormal: not called CC=26 SCAR=65.5
Pod
undocumented
| |||||||||||||||||||||
| 134 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 135 | # type => 'DetectSpaces' | ||||||||||||||||||||
| 136 | 0 | ▶ | if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 137 | 0 | return 1 | |||||||||||||||||||
| 138 | } | ||||||||||||||||||||
| 139 | # String => '#\s*if\s+0' | ||||||||||||||||||||
| 140 | # attribute => 'Preprocessor' | ||||||||||||||||||||
| 141 | # beginRegion => 'Outscoped' | ||||||||||||||||||||
| 142 | # context => 'Outscoped' | ||||||||||||||||||||
| 143 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 144 | # type => 'RegExpr' | ||||||||||||||||||||
| 145 | 0 | ▶ | if ($self->testRegExpr($text, '#\\s*if\\s+0', 0, 0, 0, undef, 1, 'Outscoped', 'Preprocessor')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 146 | 0 | return 1 | |||||||||||||||||||
| 147 | } | ||||||||||||||||||||
| 148 | # attribute => 'Preprocessor' | ||||||||||||||||||||
| 149 | # char => '#' | ||||||||||||||||||||
| 150 | # context => 'Preprocessor' | ||||||||||||||||||||
| 151 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 152 | # type => 'DetectChar' | ||||||||||||||||||||
| 153 | 0 | ▶ | if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Preprocessor', 'Preprocessor')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 154 | 0 | return 1 | |||||||||||||||||||
| 155 | } | ||||||||||||||||||||
| 156 | # String => 'keywords' | ||||||||||||||||||||
| 157 | # attribute => 'Keyword' | ||||||||||||||||||||
| 158 | # context => '#stay' | ||||||||||||||||||||
| 159 | # type => 'keyword' | ||||||||||||||||||||
| 160 | 0 | ▶ | if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 161 | 0 | return 1 | |||||||||||||||||||
| 162 | } | ||||||||||||||||||||
| 163 | # String => 'types' | ||||||||||||||||||||
| 164 | # attribute => 'Data Type' | ||||||||||||||||||||
| 165 | # context => '#stay' | ||||||||||||||||||||
| 166 | # type => 'keyword' | ||||||||||||||||||||
| 167 | 0 | ▶ | if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 168 | 0 | return 1 | |||||||||||||||||||
| 169 | } | ||||||||||||||||||||
| 170 | # type => 'DetectIdentifier' | ||||||||||||||||||||
| 171 | 0 | ▶ | if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 172 | 0 | return 1 | |||||||||||||||||||
| 173 | } | ||||||||||||||||||||
| 174 | # attribute => 'Symbol' | ||||||||||||||||||||
| 175 | # beginRegion => 'Brace1' | ||||||||||||||||||||
| 176 | # char => '{' | ||||||||||||||||||||
| 177 | # context => '#stay' | ||||||||||||||||||||
| 178 | # type => 'DetectChar' | ||||||||||||||||||||
| 179 | 0 | ▶ | if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 180 | 0 | return 1 | |||||||||||||||||||
| 181 | } | ||||||||||||||||||||
| 182 | # attribute => 'Symbol' | ||||||||||||||||||||
| 183 | # char => '}' | ||||||||||||||||||||
| 184 | # context => '#stay' | ||||||||||||||||||||
| 185 | # endRegion => 'Brace1' | ||||||||||||||||||||
| 186 | # type => 'DetectChar' | ||||||||||||||||||||
| 187 | 0 | ▶ | if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 188 | 0 | return 1 | |||||||||||||||||||
| 189 | } | ||||||||||||||||||||
| 190 | # attribute => 'Float' | ||||||||||||||||||||
| 191 | # context => '#stay' | ||||||||||||||||||||
| 192 | # items => 'ARRAY(0xec1180)' | ||||||||||||||||||||
| 193 | # type => 'Float' | ||||||||||||||||||||
| 194 | 0 | ▶ | if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 195 | # String => 'fF' | ||||||||||||||||||||
| 196 | # attribute => 'Float' | ||||||||||||||||||||
| 197 | # context => '#stay' | ||||||||||||||||||||
| 198 | # type => 'AnyChar' | ||||||||||||||||||||
| 199 | 0 | ▶ | if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 200 | 0 | return 1 | |||||||||||||||||||
| 201 | } | ||||||||||||||||||||
| 202 | } | ||||||||||||||||||||
| 203 | # attribute => 'Octal' | ||||||||||||||||||||
| 204 | # context => '#stay' | ||||||||||||||||||||
| 205 | # type => 'HlCOct' | ||||||||||||||||||||
| 206 | 0 | ▶ | if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 207 | 0 | return 1 | |||||||||||||||||||
| 208 | } | ||||||||||||||||||||
| 209 | # attribute => 'Hex' | ||||||||||||||||||||
| 210 | # context => '#stay' | ||||||||||||||||||||
| 211 | # type => 'HlCHex' | ||||||||||||||||||||
| 212 | 0 | ▶ | if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 213 | 0 | return 1 | |||||||||||||||||||
| 214 | } | ||||||||||||||||||||
| 215 | # attribute => 'Decimal' | ||||||||||||||||||||
| 216 | # context => '#stay' | ||||||||||||||||||||
| 217 | # items => 'ARRAY(0xef8f50)' | ||||||||||||||||||||
| 218 | # type => 'Int' | ||||||||||||||||||||
| 219 | 0 | ▶ | if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 220 | # String => 'ULL' | ||||||||||||||||||||
| 221 | # attribute => 'Decimal' | ||||||||||||||||||||
| 222 | # context => '#stay' | ||||||||||||||||||||
| 223 | # insensitive => 'TRUE' | ||||||||||||||||||||
| 224 | # type => 'StringDetect' | ||||||||||||||||||||
| 225 | 0 | ▶ | if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 226 | 0 | return 1 | |||||||||||||||||||
| 227 | } | ||||||||||||||||||||
| 228 | # String => 'LUL' | ||||||||||||||||||||
| 229 | # attribute => 'Decimal' | ||||||||||||||||||||
| 230 | # context => '#stay' | ||||||||||||||||||||
| 231 | # insensitive => 'TRUE' | ||||||||||||||||||||
| 232 | # type => 'StringDetect' | ||||||||||||||||||||
| 233 | 0 | ▶ | if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 234 | 0 | return 1 | |||||||||||||||||||
| 235 | } | ||||||||||||||||||||
| 236 | # String => 'LLU' | ||||||||||||||||||||
| 237 | # attribute => 'Decimal' | ||||||||||||||||||||
| 238 | # context => '#stay' | ||||||||||||||||||||
| 239 | # insensitive => 'TRUE' | ||||||||||||||||||||
| 240 | # type => 'StringDetect' | ||||||||||||||||||||
| 241 | 0 | ▶ | if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 242 | 0 | return 1 | |||||||||||||||||||
| 243 | } | ||||||||||||||||||||
| 244 | # String => 'UL' | ||||||||||||||||||||
| 245 | # attribute => 'Decimal' | ||||||||||||||||||||
| 246 | # context => '#stay' | ||||||||||||||||||||
| 247 | # insensitive => 'TRUE' | ||||||||||||||||||||
| 248 | # type => 'StringDetect' | ||||||||||||||||||||
| 249 | 0 | ▶ | if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 250 | 0 | return 1 | |||||||||||||||||||
| 251 | } | ||||||||||||||||||||
| 252 | # String => 'LU' | ||||||||||||||||||||
| 253 | # attribute => 'Decimal' | ||||||||||||||||||||
| 254 | # context => '#stay' | ||||||||||||||||||||
| 255 | # insensitive => 'TRUE' | ||||||||||||||||||||
| 256 | # type => 'StringDetect' | ||||||||||||||||||||
| 257 | 0 | ▶ | if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 258 | 0 | return 1 | |||||||||||||||||||
| 259 | } | ||||||||||||||||||||
| 260 | # String => 'LL' | ||||||||||||||||||||
| 261 | # attribute => 'Decimal' | ||||||||||||||||||||
| 262 | # context => '#stay' | ||||||||||||||||||||
| 263 | # insensitive => 'TRUE' | ||||||||||||||||||||
| 264 | # type => 'StringDetect' | ||||||||||||||||||||
| 265 | 0 | ▶ | if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 266 | 0 | return 1 | |||||||||||||||||||
| 267 | } | ||||||||||||||||||||
| 268 | # String => 'U' | ||||||||||||||||||||
| 269 | # attribute => 'Decimal' | ||||||||||||||||||||
| 270 | # context => '#stay' | ||||||||||||||||||||
| 271 | # insensitive => 'TRUE' | ||||||||||||||||||||
| 272 | # type => 'StringDetect' | ||||||||||||||||||||
| 273 | 0 | ▶ | if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 274 | 0 | return 1 | |||||||||||||||||||
| 275 | } | ||||||||||||||||||||
| 276 | # String => 'L' | ||||||||||||||||||||
| 277 | # attribute => 'Decimal' | ||||||||||||||||||||
| 278 | # context => '#stay' | ||||||||||||||||||||
| 279 | # insensitive => 'TRUE' | ||||||||||||||||||||
| 280 | # type => 'StringDetect' | ||||||||||||||||||||
| 281 | 0 | ▶ | if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 282 | 0 | return 1 | |||||||||||||||||||
| 283 | } | ||||||||||||||||||||
| 284 | } | ||||||||||||||||||||
| 285 | # attribute => 'Char' | ||||||||||||||||||||
| 286 | # context => '#stay' | ||||||||||||||||||||
| 287 | # type => 'HlCChar' | ||||||||||||||||||||
| 288 | 0 | ▶ | if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 289 | 0 | return 1 | |||||||||||||||||||
| 290 | } | ||||||||||||||||||||
| 291 | # attribute => 'String' | ||||||||||||||||||||
| 292 | # char => '"' | ||||||||||||||||||||
| 293 | # context => 'String' | ||||||||||||||||||||
| 294 | # type => 'DetectChar' | ||||||||||||||||||||
| 295 | 0 | ▶ | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 296 | 0 | return 1 | |||||||||||||||||||
| 297 | } | ||||||||||||||||||||
| 298 | # attribute => 'Comment' | ||||||||||||||||||||
| 299 | # beginRegion => 'blockcomment' | ||||||||||||||||||||
| 300 | # char => '/' | ||||||||||||||||||||
| 301 | # char1 => '*' | ||||||||||||||||||||
| 302 | # context => 'comment' | ||||||||||||||||||||
| 303 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 304 | 0 | ▶ | if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 305 | 0 | return 1 | |||||||||||||||||||
| 306 | } | ||||||||||||||||||||
| 307 | # String => ':!%&()+,-/.*<=>?[]|~^;' | ||||||||||||||||||||
| 308 | # attribute => 'Symbol' | ||||||||||||||||||||
| 309 | # context => '#stay' | ||||||||||||||||||||
| 310 | # type => 'AnyChar' | ||||||||||||||||||||
| 311 | 0 | ▶ | if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]|~^;', 0, 0, undef, 0, '#stay', 'Symbol')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 312 | 0 | return 1 | |||||||||||||||||||
| 313 | } | ||||||||||||||||||||
| 314 | 0 | return 0; | |||||||||||||||||||
| 315 | }; | ||||||||||||||||||||
| 316 | |||||||||||||||||||||
| 317 | 0 | ▶ | sub parseOutscoped { | ||||||||||||||||||
|
Subroutine
parseOutscoped: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||
| 318 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 319 | # attribute => 'Comment' | ||||||||||||||||||||
| 320 | # beginRegion => 'Comment' | ||||||||||||||||||||
| 321 | # char => '/' | ||||||||||||||||||||
| 322 | # char1 => '*' | ||||||||||||||||||||
| 323 | # context => 'comment' | ||||||||||||||||||||
| 324 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 325 | 0 | ▶ | if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 326 | 0 | return 1 | |||||||||||||||||||
| 327 | } | ||||||||||||||||||||
| 328 | # context => '##Alerts' | ||||||||||||||||||||
| 329 | # type => 'IncludeRules' | ||||||||||||||||||||
| 330 | 0 | ▶ | if ($self->includePlugin('Alerts', $text)) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 331 | 0 | return 1 | |||||||||||||||||||
| 332 | } | ||||||||||||||||||||
| 333 | # String => '#\s*if' | ||||||||||||||||||||
| 334 | # attribute => 'Comment' | ||||||||||||||||||||
| 335 | # beginRegion => 'Outscoped' | ||||||||||||||||||||
| 336 | # context => 'Outscoped intern' | ||||||||||||||||||||
| 337 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 338 | # type => 'RegExpr' | ||||||||||||||||||||
| 339 | 0 | ▶ | if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 340 | 0 | return 1 | |||||||||||||||||||
| 341 | } | ||||||||||||||||||||
| 342 | # String => '#\s*(endif|else|elif)' | ||||||||||||||||||||
| 343 | # attribute => 'Preprocessor' | ||||||||||||||||||||
| 344 | # context => '#pop' | ||||||||||||||||||||
| 345 | # endRegion => 'Outscoped' | ||||||||||||||||||||
| 346 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 347 | # type => 'RegExpr' | ||||||||||||||||||||
| 348 | 0 | ▶ | if ($self->testRegExpr($text, '#\\s*(endif|else|elif)', 0, 0, 0, undef, 1, '#pop', 'Preprocessor')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 349 | 0 | return 1 | |||||||||||||||||||
| 350 | } | ||||||||||||||||||||
| 351 | 0 | return 0; | |||||||||||||||||||
| 352 | }; | ||||||||||||||||||||
| 353 | |||||||||||||||||||||
| 354 | 0 | ▶ | sub parseOutscopedintern { | ||||||||||||||||||
|
Subroutine
parseOutscopedintern: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||
| 355 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 356 | # attribute => 'Comment' | ||||||||||||||||||||
| 357 | # beginRegion => 'Comment' | ||||||||||||||||||||
| 358 | # char => '/' | ||||||||||||||||||||
| 359 | # char1 => '*' | ||||||||||||||||||||
| 360 | # context => 'comment' | ||||||||||||||||||||
| 361 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 362 | 0 | ▶ | if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 363 | 0 | return 1 | |||||||||||||||||||
| 364 | } | ||||||||||||||||||||
| 365 | # String => '#\s*if' | ||||||||||||||||||||
| 366 | # attribute => 'Comment' | ||||||||||||||||||||
| 367 | # beginRegion => 'Outscoped' | ||||||||||||||||||||
| 368 | # context => 'Outscoped intern' | ||||||||||||||||||||
| 369 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 370 | # type => 'RegExpr' | ||||||||||||||||||||
| 371 | 0 | ▶ | if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 372 | 0 | return 1 | |||||||||||||||||||
| 373 | } | ||||||||||||||||||||
| 374 | # String => '#\s*endif' | ||||||||||||||||||||
| 375 | # attribute => 'Comment' | ||||||||||||||||||||
| 376 | # context => '#pop' | ||||||||||||||||||||
| 377 | # endRegion => 'Outscoped' | ||||||||||||||||||||
| 378 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 379 | # type => 'RegExpr' | ||||||||||||||||||||
| 380 | 0 | ▶ | if ($self->testRegExpr($text, '#\\s*endif', 0, 0, 0, undef, 1, '#pop', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 381 | 0 | return 1 | |||||||||||||||||||
| 382 | } | ||||||||||||||||||||
| 383 | 0 | return 0; | |||||||||||||||||||
| 384 | }; | ||||||||||||||||||||
| 385 | |||||||||||||||||||||
| 386 | 0 | ▶ | sub parsePreprocessor { | ||||||||||||||||||
|
Subroutine
parsePreprocessor: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||
| 387 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 388 | # attribute => 'Preprocessor' | ||||||||||||||||||||
| 389 | # context => '#stay' | ||||||||||||||||||||
| 390 | # type => 'LineContinue' | ||||||||||||||||||||
| 391 | 0 | ▶ | if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 392 | 0 | return 1 | |||||||||||||||||||
| 393 | } | ||||||||||||||||||||
| 394 | # String => 'define.*((?=\\))' | ||||||||||||||||||||
| 395 | # attribute => 'Preprocessor' | ||||||||||||||||||||
| 396 | # context => 'Define' | ||||||||||||||||||||
| 397 | # type => 'RegExpr' | ||||||||||||||||||||
| 398 | 0 | ▶ | if ($self->testRegExpr($text, 'define.*((?=\\\\))', 0, 0, 0, undef, 0, 'Define', 'Preprocessor')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 399 | 0 | return 1 | |||||||||||||||||||
| 400 | } | ||||||||||||||||||||
| 401 | # String => 'define.*' | ||||||||||||||||||||
| 402 | # attribute => 'Preprocessor' | ||||||||||||||||||||
| 403 | # context => '#stay' | ||||||||||||||||||||
| 404 | # type => 'RegExpr' | ||||||||||||||||||||
| 405 | 0 | ▶ | if ($self->testRegExpr($text, 'define.*', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 406 | 0 | return 1 | |||||||||||||||||||
| 407 | } | ||||||||||||||||||||
| 408 | # attribute => 'Prep. Lib' | ||||||||||||||||||||
| 409 | # char => '"' | ||||||||||||||||||||
| 410 | # char1 => '"' | ||||||||||||||||||||
| 411 | # context => '#stay' | ||||||||||||||||||||
| 412 | # type => 'RangeDetect' | ||||||||||||||||||||
| 413 | 0 | ▶ | if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Prep. Lib')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 414 | 0 | return 1 | |||||||||||||||||||
| 415 | } | ||||||||||||||||||||
| 416 | # attribute => 'Prep. Lib' | ||||||||||||||||||||
| 417 | # char => '<' | ||||||||||||||||||||
| 418 | # char1 => '>' | ||||||||||||||||||||
| 419 | # context => '#stay' | ||||||||||||||||||||
| 420 | # type => 'RangeDetect' | ||||||||||||||||||||
| 421 | 0 | ▶ | if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Prep. Lib')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 422 | 0 | return 1 | |||||||||||||||||||
| 423 | } | ||||||||||||||||||||
| 424 | # attribute => 'Comment' | ||||||||||||||||||||
| 425 | # beginRegion => 'blockcomment' | ||||||||||||||||||||
| 426 | # char => '/' | ||||||||||||||||||||
| 427 | # char1 => '*' | ||||||||||||||||||||
| 428 | # context => 'comment' | ||||||||||||||||||||
| 429 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 430 | 0 | ▶ | if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 431 | 0 | return 1 | |||||||||||||||||||
| 432 | } | ||||||||||||||||||||
| 433 | 0 | return 0; | |||||||||||||||||||
| 434 | }; | ||||||||||||||||||||
| 435 | |||||||||||||||||||||
| 436 | 0 | ▶ | sub parseString { | ||||||||||||||||||
|
Subroutine
parseString: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||
| 437 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 438 | # attribute => 'String' | ||||||||||||||||||||
| 439 | # context => '#stay' | ||||||||||||||||||||
| 440 | # type => 'LineContinue' | ||||||||||||||||||||
| 441 | 0 | ▶ | if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 442 | 0 | return 1 | |||||||||||||||||||
| 443 | } | ||||||||||||||||||||
| 444 | # attribute => 'String Char' | ||||||||||||||||||||
| 445 | # context => '#stay' | ||||||||||||||||||||
| 446 | # type => 'HlCStringChar' | ||||||||||||||||||||
| 447 | 0 | ▶ | if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 448 | 0 | return 1 | |||||||||||||||||||
| 449 | } | ||||||||||||||||||||
| 450 | # attribute => 'String' | ||||||||||||||||||||
| 451 | # char => '"' | ||||||||||||||||||||
| 452 | # context => '#pop' | ||||||||||||||||||||
| 453 | # type => 'DetectChar' | ||||||||||||||||||||
| 454 | 0 | ▶ | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 455 | 0 | return 1 | |||||||||||||||||||
| 456 | } | ||||||||||||||||||||
| 457 | 0 | return 0; | |||||||||||||||||||
| 458 | }; | ||||||||||||||||||||
| 459 | |||||||||||||||||||||
| 460 | 0 | ▶ | sub parsecomment { | ||||||||||||||||||
|
Subroutine
parsecomment: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||
| 461 | 0 | my ($self, $text) = @_; | |||||||||||||||||||
| 462 | # attribute => 'Comment' | ||||||||||||||||||||
| 463 | # char => '*' | ||||||||||||||||||||
| 464 | # char1 => '/' | ||||||||||||||||||||
| 465 | # context => '#pop' | ||||||||||||||||||||
| 466 | # endRegion => 'blockcomment' | ||||||||||||||||||||
| 467 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 468 | 0 | ▶ | if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 469 | 0 | return 1 | |||||||||||||||||||
| 470 | } | ||||||||||||||||||||
| 471 | # context => '##Alerts' | ||||||||||||||||||||
| 472 | # type => 'IncludeRules' | ||||||||||||||||||||
| 473 | 0 | ▶ | if ($self->includePlugin('Alerts', $text)) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 474 | 0 | return 1 | |||||||||||||||||||
| 475 | } | ||||||||||||||||||||
| 476 | 0 | return 0; | |||||||||||||||||||
| 477 | }; | ||||||||||||||||||||
| 478 | |||||||||||||||||||||
| 479 | |||||||||||||||||||||
| 480 | 1 | 1; | |||||||||||||||||||
| 481 | |||||||||||||||||||||
| 482 | __END__ | ||||||||||||||||||||