| 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 'mediawiki.xml' file of the syntax highlight | ||||||||||||||||||||
| 6 | # engine of the kate text editor (http://www.kate-editor.org | ||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | #kate xml version 1.00 | ||||||||||||||||||||
| 9 | #kate version 2.4 | ||||||||||||||||||||
| 10 | #generated: Sun Feb 3 22:02:06 2008, localtime | ||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | package Syntax::Highlight::Engine::Kate::Wikimedia; | ||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 1 | our $VERSION = '0.14'; | |||||||||||||||||||
| 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 | sub new { | ||||||||||||||||||||
| 21 | 1 | ▶ | my $proto = shift; | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||
| 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 | 'Comment' => 'Comment', | ||||||||||||||||||||
| 26 | 'Error' => 'Error', | ||||||||||||||||||||
| 27 | 'HTML-Entity' => 'DecVal', | ||||||||||||||||||||
| 28 | 'HTML-Tag' => 'Keyword', | ||||||||||||||||||||
| 29 | 'Link' => 'Others', | ||||||||||||||||||||
| 30 | 'NoWiki' => 'Normal', | ||||||||||||||||||||
| 31 | 'Normal' => 'Normal', | ||||||||||||||||||||
| 32 | 'Section' => 'Keyword', | ||||||||||||||||||||
| 33 | 'URL' => 'Others', | ||||||||||||||||||||
| 34 | 'Unformatted' => 'Normal', | ||||||||||||||||||||
| 35 | 'Wiki-Tag' => 'DecVal', | ||||||||||||||||||||
| 36 | }); | ||||||||||||||||||||
| 37 | 1 | $self->contextdata({ | |||||||||||||||||||
| 38 | 'Error' => { | ||||||||||||||||||||
| 39 | callback => \&parseError, | ||||||||||||||||||||
| 40 | attribute => 'Error', | ||||||||||||||||||||
| 41 | lineending => '#pop', | ||||||||||||||||||||
| 42 | }, | ||||||||||||||||||||
| 43 | 'Link' => { | ||||||||||||||||||||
| 44 | callback => \&parseLink, | ||||||||||||||||||||
| 45 | attribute => 'Template', | ||||||||||||||||||||
| 46 | }, | ||||||||||||||||||||
| 47 | 'NoWiki' => { | ||||||||||||||||||||
| 48 | callback => \&parseNoWiki, | ||||||||||||||||||||
| 49 | attribute => 'NoWiki', | ||||||||||||||||||||
| 50 | }, | ||||||||||||||||||||
| 51 | 'Pre' => { | ||||||||||||||||||||
| 52 | callback => \&parsePre, | ||||||||||||||||||||
| 53 | attribute => 'NoWiki', | ||||||||||||||||||||
| 54 | }, | ||||||||||||||||||||
| 55 | 'Table' => { | ||||||||||||||||||||
| 56 | callback => \&parseTable, | ||||||||||||||||||||
| 57 | attribute => 'Normal', | ||||||||||||||||||||
| 58 | }, | ||||||||||||||||||||
| 59 | 'Template' => { | ||||||||||||||||||||
| 60 | callback => \&parseTemplate, | ||||||||||||||||||||
| 61 | attribute => 'Link', | ||||||||||||||||||||
| 62 | }, | ||||||||||||||||||||
| 63 | 'URL' => { | ||||||||||||||||||||
| 64 | callback => \&parseURL, | ||||||||||||||||||||
| 65 | attribute => 'Link', | ||||||||||||||||||||
| 66 | }, | ||||||||||||||||||||
| 67 | 'Unformatted' => { | ||||||||||||||||||||
| 68 | callback => \&parseUnformatted, | ||||||||||||||||||||
| 69 | attribute => 'Unformatted', | ||||||||||||||||||||
| 70 | lineending => '#pop', | ||||||||||||||||||||
| 71 | }, | ||||||||||||||||||||
| 72 | 'WikiLink' => { | ||||||||||||||||||||
| 73 | callback => \&parseWikiLink, | ||||||||||||||||||||
| 74 | attribute => 'Link', | ||||||||||||||||||||
| 75 | }, | ||||||||||||||||||||
| 76 | 'comment' => { | ||||||||||||||||||||
| 77 | callback => \&parsecomment, | ||||||||||||||||||||
| 78 | attribute => 'Comment', | ||||||||||||||||||||
| 79 | }, | ||||||||||||||||||||
| 80 | 'normal' => { | ||||||||||||||||||||
| 81 | callback => \&parsenormal, | ||||||||||||||||||||
| 82 | attribute => 'Normal', | ||||||||||||||||||||
| 83 | }, | ||||||||||||||||||||
| 84 | }); | ||||||||||||||||||||
| 85 | 1 | $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); | |||||||||||||||||||
| 86 | 1 | $self->basecontext('normal'); | |||||||||||||||||||
| 87 | 1 | $self->keywordscase(0); | |||||||||||||||||||
| 88 | 1 | $self->initialize; | |||||||||||||||||||
| 89 | 1 | bless ($self, $class); | |||||||||||||||||||
| 90 | 1 | return $self; | |||||||||||||||||||
| 91 | } | ||||||||||||||||||||
| 92 | |||||||||||||||||||||
| 93 | sub language { | ||||||||||||||||||||
| 94 | 0 | ▶ | return 'Wikimedia'; | ||||||||||||||||||
|
Subroutine
language: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 95 | } | ||||||||||||||||||||
| 96 | |||||||||||||||||||||
| 97 | sub parseError { | ||||||||||||||||||||
| 98 | 0 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseError: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 99 | 0 | return 0; | |||||||||||||||||||
| 100 | }; | ||||||||||||||||||||
| 101 | |||||||||||||||||||||
| 102 | sub parseLink { | ||||||||||||||||||||
| 103 | 0 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseLink: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||
| 104 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 105 | # char => '}' | ||||||||||||||||||||
| 106 | # char1 => '}' | ||||||||||||||||||||
| 107 | # context => '#pop' | ||||||||||||||||||||
| 108 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 109 | 0 | ▶ | if ($self->testDetect2Chars($text, '}', '}', 0, 0, 0, undef, 0, '#pop', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 110 | 0 | return 1 | |||||||||||||||||||
| 111 | } | ||||||||||||||||||||
| 112 | # String => ''[]' | ||||||||||||||||||||
| 113 | # attribute => 'Error' | ||||||||||||||||||||
| 114 | # context => 'Error' | ||||||||||||||||||||
| 115 | # type => 'AnyChar' | ||||||||||||||||||||
| 116 | 0 | ▶ | if ($self->testAnyChar($text, '\'[]', 0, 0, undef, 0, 'Error', 'Error')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 117 | 0 | return 1 | |||||||||||||||||||
| 118 | } | ||||||||||||||||||||
| 119 | 0 | return 0; | |||||||||||||||||||
| 120 | }; | ||||||||||||||||||||
| 121 | |||||||||||||||||||||
| 122 | sub parseNoWiki { | ||||||||||||||||||||
| 123 | 0 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseNoWiki: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||
| 124 | # String => '<!--[^-]*-->' | ||||||||||||||||||||
| 125 | # attribute => 'NoWiki' | ||||||||||||||||||||
| 126 | # type => 'RegExpr' | ||||||||||||||||||||
| 127 | 0 | ▶ | if ($self->testRegExpr($text, '<!--[^-]*-->', 0, 0, 0, undef, 0, '#stay', 'NoWiki')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 128 | 0 | return 1 | |||||||||||||||||||
| 129 | } | ||||||||||||||||||||
| 130 | # String => '</nowiki>' | ||||||||||||||||||||
| 131 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 132 | # context => '#pop' | ||||||||||||||||||||
| 133 | # type => 'StringDetect' | ||||||||||||||||||||
| 134 | 0 | ▶ | if ($self->testStringDetect($text, '</nowiki>', 0, 0, 0, undef, 0, '#pop', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 135 | 0 | return 1 | |||||||||||||||||||
| 136 | } | ||||||||||||||||||||
| 137 | # String => '[<][^>]+[>]' | ||||||||||||||||||||
| 138 | # attribute => 'HTML-Tag' | ||||||||||||||||||||
| 139 | # context => '#stay' | ||||||||||||||||||||
| 140 | # type => 'RegExpr' | ||||||||||||||||||||
| 141 | 0 | ▶ | if ($self->testRegExpr($text, '[<][^>]+[>]', 0, 0, 0, undef, 0, '#stay', 'HTML-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 142 | 0 | return 1 | |||||||||||||||||||
| 143 | } | ||||||||||||||||||||
| 144 | # String => '<pre>' | ||||||||||||||||||||
| 145 | # attribute => 'HTML-Tag' | ||||||||||||||||||||
| 146 | # context => 'Pre' | ||||||||||||||||||||
| 147 | # type => 'StringDetect' | ||||||||||||||||||||
| 148 | 0 | ▶ | if ($self->testStringDetect($text, '<pre>', 0, 0, 0, undef, 0, 'Pre', 'HTML-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 149 | 0 | return 1 | |||||||||||||||||||
| 150 | } | ||||||||||||||||||||
| 151 | 0 | return 0; | |||||||||||||||||||
| 152 | }; | ||||||||||||||||||||
| 153 | |||||||||||||||||||||
| 154 | sub parsePre { | ||||||||||||||||||||
| 155 | 0 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parsePre: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 156 | # String => '</pre>' | ||||||||||||||||||||
| 157 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 158 | # context => '#pop' | ||||||||||||||||||||
| 159 | # type => 'StringDetect' | ||||||||||||||||||||
| 160 | 0 | ▶ | if ($self->testStringDetect($text, '</pre>', 0, 0, 0, undef, 0, '#pop', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 161 | 0 | return 1 | |||||||||||||||||||
| 162 | } | ||||||||||||||||||||
| 163 | 0 | return 0; | |||||||||||||||||||
| 164 | }; | ||||||||||||||||||||
| 165 | |||||||||||||||||||||
| 166 | sub parseTable { | ||||||||||||||||||||
| 167 | 0 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseTable: not called CC=19 SCAR=59.4
Pod
undocumented
| |||||||||||||||||||||
| 168 | # String => '<!--' | ||||||||||||||||||||
| 169 | # attribute => 'Comment' | ||||||||||||||||||||
| 170 | # context => 'comment' | ||||||||||||||||||||
| 171 | # type => 'StringDetect' | ||||||||||||||||||||
| 172 | 0 | ▶ | if ($self->testStringDetect($text, '<!--', 0, 0, 0, undef, 0, 'comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 173 | 0 | return 1 | |||||||||||||||||||
| 174 | } | ||||||||||||||||||||
| 175 | # String => '([=]{2,2}[^=]+[=]{2,2}|[=]{3,3}[^=]+[=]{3,3}|[=]{4,4}[^=]+[=]{4,4}|[=]{5,5}[^=]+[=]{5,5})' | ||||||||||||||||||||
| 176 | # attribute => 'Section' | ||||||||||||||||||||
| 177 | # column => '0' | ||||||||||||||||||||
| 178 | # context => '#stay' | ||||||||||||||||||||
| 179 | # type => 'RegExpr' | ||||||||||||||||||||
| 180 | 0 | ▶ | if ($self->testRegExpr($text, '([=]{2,2}[^=]+[=]{2,2}|[=]{3,3}[^=]+[=]{3,3}|[=]{4,4}[^=]+[=]{4,4}|[=]{5,5}[^=]+[=]{5,5})', 0, 0, 0, 0, 0, '#stay', 'Section')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 181 | 0 | return 1 | |||||||||||||||||||
| 182 | } | ||||||||||||||||||||
| 183 | # String => '[*#;:\s]*[*#:]+' | ||||||||||||||||||||
| 184 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 185 | # column => '0' | ||||||||||||||||||||
| 186 | # context => '#stay' | ||||||||||||||||||||
| 187 | # type => 'RegExpr' | ||||||||||||||||||||
| 188 | 0 | ▶ | if ($self->testRegExpr($text, '[*#;:\\s]*[*#:]+', 0, 0, 0, 0, 0, '#stay', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 189 | 0 | return 1 | |||||||||||||||||||
| 190 | } | ||||||||||||||||||||
| 191 | # String => '[[](?![[])' | ||||||||||||||||||||
| 192 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 193 | # context => 'URL' | ||||||||||||||||||||
| 194 | # type => 'RegExpr' | ||||||||||||||||||||
| 195 | 0 | ▶ | if ($self->testRegExpr($text, '[[](?![[])', 0, 0, 0, undef, 0, 'URL', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 196 | 0 | return 1 | |||||||||||||||||||
| 197 | } | ||||||||||||||||||||
| 198 | # String => '(http:|ftp:|mailto:)[\S]*($|[\s])' | ||||||||||||||||||||
| 199 | # attribute => 'URL' | ||||||||||||||||||||
| 200 | # context => '#stay' | ||||||||||||||||||||
| 201 | # type => 'RegExpr' | ||||||||||||||||||||
| 202 | 0 | ▶ | if ($self->testRegExpr($text, '(http:|ftp:|mailto:)[\\S]*($|[\\s])', 0, 0, 0, undef, 0, '#stay', 'URL')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 203 | 0 | return 1 | |||||||||||||||||||
| 204 | } | ||||||||||||||||||||
| 205 | # String => '[']{2,}' | ||||||||||||||||||||
| 206 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 207 | # context => '#stay' | ||||||||||||||||||||
| 208 | # type => 'RegExpr' | ||||||||||||||||||||
| 209 | 0 | ▶ | if ($self->testRegExpr($text, '[\']{2,}', 0, 0, 0, undef, 0, '#stay', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 210 | 0 | return 1 | |||||||||||||||||||
| 211 | } | ||||||||||||||||||||
| 212 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 213 | # char => '|' | ||||||||||||||||||||
| 214 | # char1 => '}' | ||||||||||||||||||||
| 215 | # column => '0' | ||||||||||||||||||||
| 216 | # context => '#pop' | ||||||||||||||||||||
| 217 | # endRegion => 'table' | ||||||||||||||||||||
| 218 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 219 | 0 | ▶ | if ($self->testDetect2Chars($text, '|', '}', 0, 0, 0, 0, 0, '#pop', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 220 | 0 | return 1 | |||||||||||||||||||
| 221 | } | ||||||||||||||||||||
| 222 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 223 | # char => '|' | ||||||||||||||||||||
| 224 | # context => '#stay' | ||||||||||||||||||||
| 225 | # type => 'DetectChar' | ||||||||||||||||||||
| 226 | 0 | ▶ | if ($self->testDetectChar($text, '|', 0, 0, 0, undef, 0, '#stay', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 227 | 0 | return 1 | |||||||||||||||||||
| 228 | } | ||||||||||||||||||||
| 229 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 230 | # char => '{' | ||||||||||||||||||||
| 231 | # char1 => '{' | ||||||||||||||||||||
| 232 | # context => 'Template' | ||||||||||||||||||||
| 233 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 234 | 0 | ▶ | if ($self->testDetect2Chars($text, '{', '{', 0, 0, 0, undef, 0, 'Template', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 235 | 0 | return 1 | |||||||||||||||||||
| 236 | } | ||||||||||||||||||||
| 237 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 238 | # char => '[' | ||||||||||||||||||||
| 239 | # char1 => '[' | ||||||||||||||||||||
| 240 | # context => 'WikiLink' | ||||||||||||||||||||
| 241 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 242 | 0 | ▶ | if ($self->testDetect2Chars($text, '[', '[', 0, 0, 0, undef, 0, 'WikiLink', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 243 | 0 | return 1 | |||||||||||||||||||
| 244 | } | ||||||||||||||||||||
| 245 | # attribute => 'HTML-Entity' | ||||||||||||||||||||
| 246 | # char => '&' | ||||||||||||||||||||
| 247 | # char1 => ';' | ||||||||||||||||||||
| 248 | # context => '#stay' | ||||||||||||||||||||
| 249 | # type => 'RangeDetect' | ||||||||||||||||||||
| 250 | 0 | ▶ | if ($self->testRangeDetect($text, '&', ';', 0, 0, undef, 0, '#stay', 'HTML-Entity')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 251 | 0 | return 1 | |||||||||||||||||||
| 252 | } | ||||||||||||||||||||
| 253 | # String => '<nowiki>' | ||||||||||||||||||||
| 254 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 255 | # context => 'NoWiki' | ||||||||||||||||||||
| 256 | # type => 'StringDetect' | ||||||||||||||||||||
| 257 | 0 | ▶ | if ($self->testStringDetect($text, '<nowiki>', 0, 0, 0, undef, 0, 'NoWiki', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 258 | 0 | return 1 | |||||||||||||||||||
| 259 | } | ||||||||||||||||||||
| 260 | # String => '<pre>' | ||||||||||||||||||||
| 261 | # attribute => 'HTML-Tag' | ||||||||||||||||||||
| 262 | # context => 'Pre' | ||||||||||||||||||||
| 263 | # type => 'StringDetect' | ||||||||||||||||||||
| 264 | 0 | ▶ | if ($self->testStringDetect($text, '<pre>', 0, 0, 0, undef, 0, 'Pre', 'HTML-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 265 | 0 | return 1 | |||||||||||||||||||
| 266 | } | ||||||||||||||||||||
| 267 | # String => '[<][^>]+[>]' | ||||||||||||||||||||
| 268 | # attribute => 'HTML-Tag' | ||||||||||||||||||||
| 269 | # context => '#stay' | ||||||||||||||||||||
| 270 | # type => 'RegExpr' | ||||||||||||||||||||
| 271 | 0 | ▶ | if ($self->testRegExpr($text, '[<][^>]+[>]', 0, 0, 0, undef, 0, '#stay', 'HTML-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 272 | 0 | return 1 | |||||||||||||||||||
| 273 | } | ||||||||||||||||||||
| 274 | # String => '[\s]' | ||||||||||||||||||||
| 275 | # column => '0' | ||||||||||||||||||||
| 276 | # context => 'Unformatted' | ||||||||||||||||||||
| 277 | # type => 'RegExpr' | ||||||||||||||||||||
| 278 | 0 | ▶ | if ($self->testRegExpr($text, '[\\s]', 0, 0, 0, 0, 0, 'Unformatted', undef)) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 279 | 0 | return 1 | |||||||||||||||||||
| 280 | } | ||||||||||||||||||||
| 281 | # String => '[~]{3,4}' | ||||||||||||||||||||
| 282 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 283 | # context => '#stay' | ||||||||||||||||||||
| 284 | # type => 'RegExpr' | ||||||||||||||||||||
| 285 | 0 | ▶ | if ($self->testRegExpr($text, '[~]{3,4}', 0, 0, 0, undef, 0, '#stay', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 286 | 0 | return 1 | |||||||||||||||||||
| 287 | } | ||||||||||||||||||||
| 288 | # String => '[-]{4,}' | ||||||||||||||||||||
| 289 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 290 | # context => '#stay' | ||||||||||||||||||||
| 291 | # type => 'RegExpr' | ||||||||||||||||||||
| 292 | 0 | ▶ | if ($self->testRegExpr($text, '[-]{4,}', 0, 0, 0, undef, 0, '#stay', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 293 | 0 | return 1 | |||||||||||||||||||
| 294 | } | ||||||||||||||||||||
| 295 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 296 | # char => '!' | ||||||||||||||||||||
| 297 | # column => '0' | ||||||||||||||||||||
| 298 | # context => '#stay' | ||||||||||||||||||||
| 299 | # type => 'DetectChar' | ||||||||||||||||||||
| 300 | 0 | ▶ | if ($self->testDetectChar($text, '!', 0, 0, 0, 0, 0, '#stay', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 301 | 0 | return 1 | |||||||||||||||||||
| 302 | } | ||||||||||||||||||||
| 303 | 0 | return 0; | |||||||||||||||||||
| 304 | }; | ||||||||||||||||||||
| 305 | |||||||||||||||||||||
| 306 | sub parseTemplate { | ||||||||||||||||||||
| 307 | 0 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseTemplate: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||
| 308 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 309 | # char => '}' | ||||||||||||||||||||
| 310 | # char1 => '}' | ||||||||||||||||||||
| 311 | # context => '#pop' | ||||||||||||||||||||
| 312 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 313 | 0 | ▶ | if ($self->testDetect2Chars($text, '}', '}', 0, 0, 0, undef, 0, '#pop', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 314 | 0 | return 1 | |||||||||||||||||||
| 315 | } | ||||||||||||||||||||
| 316 | # attribute => 'Error' | ||||||||||||||||||||
| 317 | # char => ''' | ||||||||||||||||||||
| 318 | # context => 'Error' | ||||||||||||||||||||
| 319 | # type => 'DetectChar' | ||||||||||||||||||||
| 320 | 0 | ▶ | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'Error', 'Error')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 321 | 0 | return 1 | |||||||||||||||||||
| 322 | } | ||||||||||||||||||||
| 323 | 0 | return 0; | |||||||||||||||||||
| 324 | }; | ||||||||||||||||||||
| 325 | |||||||||||||||||||||
| 326 | sub parseURL { | ||||||||||||||||||||
| 327 | 0 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseURL: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||
| 328 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 329 | # char => ']' | ||||||||||||||||||||
| 330 | # context => '#pop' | ||||||||||||||||||||
| 331 | # type => 'DetectChar' | ||||||||||||||||||||
| 332 | 0 | ▶ | if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 333 | 0 | return 1 | |||||||||||||||||||
| 334 | } | ||||||||||||||||||||
| 335 | # attribute => 'Error' | ||||||||||||||||||||
| 336 | # char => ''' | ||||||||||||||||||||
| 337 | # context => 'Error' | ||||||||||||||||||||
| 338 | # type => 'DetectChar' | ||||||||||||||||||||
| 339 | 0 | ▶ | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'Error', 'Error')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 340 | 0 | return 1 | |||||||||||||||||||
| 341 | } | ||||||||||||||||||||
| 342 | 0 | return 0; | |||||||||||||||||||
| 343 | }; | ||||||||||||||||||||
| 344 | |||||||||||||||||||||
| 345 | sub parseUnformatted { | ||||||||||||||||||||
| 346 | 0 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseUnformatted: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 347 | 0 | return 0; | |||||||||||||||||||
| 348 | }; | ||||||||||||||||||||
| 349 | |||||||||||||||||||||
| 350 | sub parseWikiLink { | ||||||||||||||||||||
| 351 | 0 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseWikiLink: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||
| 352 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 353 | # char => '|' | ||||||||||||||||||||
| 354 | # context => '#stay' | ||||||||||||||||||||
| 355 | # type => 'DetectChar' | ||||||||||||||||||||
| 356 | 0 | ▶ | if ($self->testDetectChar($text, '|', 0, 0, 0, undef, 0, '#stay', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 357 | 0 | return 1 | |||||||||||||||||||
| 358 | } | ||||||||||||||||||||
| 359 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 360 | # char => ']' | ||||||||||||||||||||
| 361 | # char1 => ']' | ||||||||||||||||||||
| 362 | # context => '#pop' | ||||||||||||||||||||
| 363 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 364 | 0 | ▶ | if ($self->testDetect2Chars($text, ']', ']', 0, 0, 0, undef, 0, '#pop', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 365 | 0 | return 1 | |||||||||||||||||||
| 366 | } | ||||||||||||||||||||
| 367 | # attribute => 'Error' | ||||||||||||||||||||
| 368 | # char => ''' | ||||||||||||||||||||
| 369 | # context => 'Error' | ||||||||||||||||||||
| 370 | # type => 'DetectChar' | ||||||||||||||||||||
| 371 | 0 | ▶ | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'Error', 'Error')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 372 | 0 | return 1 | |||||||||||||||||||
| 373 | } | ||||||||||||||||||||
| 374 | 0 | return 0; | |||||||||||||||||||
| 375 | }; | ||||||||||||||||||||
| 376 | |||||||||||||||||||||
| 377 | sub parsecomment { | ||||||||||||||||||||
| 378 | 0 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parsecomment: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 379 | # String => '-->' | ||||||||||||||||||||
| 380 | # attribute => 'Comment' | ||||||||||||||||||||
| 381 | # context => '#pop' | ||||||||||||||||||||
| 382 | # endRegion => 'comment' | ||||||||||||||||||||
| 383 | # type => 'StringDetect' | ||||||||||||||||||||
| 384 | 0 | ▶ | if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 385 | 0 | return 1 | |||||||||||||||||||
| 386 | } | ||||||||||||||||||||
| 387 | 0 | return 0; | |||||||||||||||||||
| 388 | }; | ||||||||||||||||||||
| 389 | |||||||||||||||||||||
| 390 | sub parsenormal { | ||||||||||||||||||||
| 391 | 0 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parsenormal: not called CC=16 SCAR=56.1
Pod
undocumented
| |||||||||||||||||||||
| 392 | # String => '<!--' | ||||||||||||||||||||
| 393 | # attribute => 'Comment' | ||||||||||||||||||||
| 394 | # beginRegion => 'comment' | ||||||||||||||||||||
| 395 | # context => 'comment' | ||||||||||||||||||||
| 396 | # type => 'StringDetect' | ||||||||||||||||||||
| 397 | 0 | ▶ | if ($self->testStringDetect($text, '<!--', 0, 0, 0, undef, 0, 'comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 398 | 0 | return 1 | |||||||||||||||||||
| 399 | } | ||||||||||||||||||||
| 400 | # String => '([=]{2,2}[^=]+[=]{2,2}|[=]{3,3}[^=]+[=]{3,3}|[=]{4,4}[^=]+[=]{4,4}|[=]{5,5}[^=]+[=]{5,5})' | ||||||||||||||||||||
| 401 | # attribute => 'Section' | ||||||||||||||||||||
| 402 | # column => '0' | ||||||||||||||||||||
| 403 | # type => 'RegExpr' | ||||||||||||||||||||
| 404 | 0 | ▶ | if ($self->testRegExpr($text, '([=]{2,2}[^=]+[=]{2,2}|[=]{3,3}[^=]+[=]{3,3}|[=]{4,4}[^=]+[=]{4,4}|[=]{5,5}[^=]+[=]{5,5})', 0, 0, 0, 0, 0, '#stay', 'Section')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 405 | 0 | return 1 | |||||||||||||||||||
| 406 | } | ||||||||||||||||||||
| 407 | # String => '[~]{3,4}' | ||||||||||||||||||||
| 408 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 409 | # context => '#stay' | ||||||||||||||||||||
| 410 | # type => 'RegExpr' | ||||||||||||||||||||
| 411 | 0 | ▶ | if ($self->testRegExpr($text, '[~]{3,4}', 0, 0, 0, undef, 0, '#stay', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 412 | 0 | return 1 | |||||||||||||||||||
| 413 | } | ||||||||||||||||||||
| 414 | # String => '[*#;:\s]*[*#:]+' | ||||||||||||||||||||
| 415 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 416 | # column => '0' | ||||||||||||||||||||
| 417 | # context => '#stay' | ||||||||||||||||||||
| 418 | # type => 'RegExpr' | ||||||||||||||||||||
| 419 | 0 | ▶ | if ($self->testRegExpr($text, '[*#;:\\s]*[*#:]+', 0, 0, 0, 0, 0, '#stay', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 420 | 0 | return 1 | |||||||||||||||||||
| 421 | } | ||||||||||||||||||||
| 422 | # String => '[[](?![[])' | ||||||||||||||||||||
| 423 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 424 | # context => 'URL' | ||||||||||||||||||||
| 425 | # type => 'RegExpr' | ||||||||||||||||||||
| 426 | 0 | ▶ | if ($self->testRegExpr($text, '[[](?![[])', 0, 0, 0, undef, 0, 'URL', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 427 | 0 | return 1 | |||||||||||||||||||
| 428 | } | ||||||||||||||||||||
| 429 | # String => '(http:|ftp:|mailto:)[\S]*($|[\s])' | ||||||||||||||||||||
| 430 | # attribute => 'URL' | ||||||||||||||||||||
| 431 | # context => '#stay' | ||||||||||||||||||||
| 432 | # type => 'RegExpr' | ||||||||||||||||||||
| 433 | 0 | ▶ | if ($self->testRegExpr($text, '(http:|ftp:|mailto:)[\\S]*($|[\\s])', 0, 0, 0, undef, 0, '#stay', 'URL')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 434 | 0 | return 1 | |||||||||||||||||||
| 435 | } | ||||||||||||||||||||
| 436 | # String => '[']{2,}' | ||||||||||||||||||||
| 437 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 438 | # context => '#stay' | ||||||||||||||||||||
| 439 | # type => 'RegExpr' | ||||||||||||||||||||
| 440 | 0 | ▶ | if ($self->testRegExpr($text, '[\']{2,}', 0, 0, 0, undef, 0, '#stay', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 441 | 0 | return 1 | |||||||||||||||||||
| 442 | } | ||||||||||||||||||||
| 443 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 444 | # beginRegion => 'table' | ||||||||||||||||||||
| 445 | # char => '{' | ||||||||||||||||||||
| 446 | # char1 => '|' | ||||||||||||||||||||
| 447 | # column => '0' | ||||||||||||||||||||
| 448 | # context => 'Table' | ||||||||||||||||||||
| 449 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 450 | 0 | ▶ | if ($self->testDetect2Chars($text, '{', '|', 0, 0, 0, 0, 0, 'Table', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 451 | 0 | return 1 | |||||||||||||||||||
| 452 | } | ||||||||||||||||||||
| 453 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 454 | # char => '{' | ||||||||||||||||||||
| 455 | # char1 => '{' | ||||||||||||||||||||
| 456 | # context => 'Template' | ||||||||||||||||||||
| 457 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 458 | 0 | ▶ | if ($self->testDetect2Chars($text, '{', '{', 0, 0, 0, undef, 0, 'Template', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 459 | 0 | return 1 | |||||||||||||||||||
| 460 | } | ||||||||||||||||||||
| 461 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 462 | # char => '[' | ||||||||||||||||||||
| 463 | # char1 => '[' | ||||||||||||||||||||
| 464 | # context => 'WikiLink' | ||||||||||||||||||||
| 465 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 466 | 0 | ▶ | if ($self->testDetect2Chars($text, '[', '[', 0, 0, 0, undef, 0, 'WikiLink', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 467 | 0 | return 1 | |||||||||||||||||||
| 468 | } | ||||||||||||||||||||
| 469 | # attribute => 'HTML-Entity' | ||||||||||||||||||||
| 470 | # char => '&' | ||||||||||||||||||||
| 471 | # char1 => ';' | ||||||||||||||||||||
| 472 | # context => '#stay' | ||||||||||||||||||||
| 473 | # type => 'RangeDetect' | ||||||||||||||||||||
| 474 | 0 | ▶ | if ($self->testRangeDetect($text, '&', ';', 0, 0, undef, 0, '#stay', 'HTML-Entity')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 475 | 0 | return 1 | |||||||||||||||||||
| 476 | } | ||||||||||||||||||||
| 477 | # String => '<nowiki>' | ||||||||||||||||||||
| 478 | # attribute => 'Wiki-Tag' | ||||||||||||||||||||
| 479 | # context => 'NoWiki' | ||||||||||||||||||||
| 480 | # type => 'StringDetect' | ||||||||||||||||||||
| 481 | 0 | ▶ | if ($self->testStringDetect($text, '<nowiki>', 0, 0, 0, undef, 0, 'NoWiki', 'Wiki-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 482 | 0 | return 1 | |||||||||||||||||||
| 483 | } | ||||||||||||||||||||
| 484 | # String => '<pre>' | ||||||||||||||||||||
| 485 | # attribute => 'HTML-Tag' | ||||||||||||||||||||
| 486 | # context => 'Pre' | ||||||||||||||||||||
| 487 | # type => 'StringDetect' | ||||||||||||||||||||
| 488 | 0 | ▶ | if ($self->testStringDetect($text, '<pre>', 0, 0, 0, undef, 0, 'Pre', 'HTML-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 489 | 0 | return 1 | |||||||||||||||||||
| 490 | } | ||||||||||||||||||||
| 491 | # String => '[<][^>]+[>]' | ||||||||||||||||||||
| 492 | # attribute => 'HTML-Tag' | ||||||||||||||||||||
| 493 | # context => '#stay' | ||||||||||||||||||||
| 494 | # type => 'RegExpr' | ||||||||||||||||||||
| 495 | 0 | ▶ | if ($self->testRegExpr($text, '[<][^>]+[>]', 0, 0, 0, undef, 0, '#stay', 'HTML-Tag')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 496 | 0 | return 1 | |||||||||||||||||||
| 497 | } | ||||||||||||||||||||
| 498 | # String => '[\s]' | ||||||||||||||||||||
| 499 | # column => '0' | ||||||||||||||||||||
| 500 | # context => 'Unformatted' | ||||||||||||||||||||
| 501 | # type => 'RegExpr' | ||||||||||||||||||||
| 502 | 0 | ▶ | if ($self->testRegExpr($text, '[\\s]', 0, 0, 0, 0, 0, 'Unformatted', undef)) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 503 | 0 | return 1 | |||||||||||||||||||
| 504 | } | ||||||||||||||||||||
| 505 | 0 | return 0; | |||||||||||||||||||
| 506 | }; | ||||||||||||||||||||
| 507 | |||||||||||||||||||||
| 508 | |||||||||||||||||||||
| 509 | 1 | 1; | |||||||||||||||||||
| 510 | |||||||||||||||||||||
| 511 | __END__ | ||||||||||||||||||||