| 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 'latex.xml' file of the syntax highlight | ||||||||||||||||||||
| 6 | # engine of the kate text editor (http://www.kate-editor.org | ||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | #kate xml version 1.14 | ||||||||||||||||||||
| 9 | #kate version 2.4 | ||||||||||||||||||||
| 10 | #kate author Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net) | ||||||||||||||||||||
| 11 | #generated: Sun Feb 3 22:02:05 2008, localtime | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | package Syntax::Highlight::Engine::Kate::LaTeX; | ||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 1 | our $VERSION = '0.14'; | |||||||||||||||||||
| 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 | sub new { | ||||||||||||||||||||
| 22 | 2 | ▶ | my $proto = shift; | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||
| 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 | 'Comment' => 'Comment', | ||||||||||||||||||||
| 27 | 'Environment' => 'DataType', | ||||||||||||||||||||
| 28 | 'Keyword' => 'Keyword', | ||||||||||||||||||||
| 29 | 'Keyword Mathmode' => 'Reserved', | ||||||||||||||||||||
| 30 | 'Math' => 'Float', | ||||||||||||||||||||
| 31 | 'Normal Text' => 'Normal', | ||||||||||||||||||||
| 32 | 'Region Marker' => 'RegionMarker', | ||||||||||||||||||||
| 33 | 'Structure' => 'String', | ||||||||||||||||||||
| 34 | 'Verbatim' => 'BString', | ||||||||||||||||||||
| 35 | }); | ||||||||||||||||||||
| 36 | 2 | $self->contextdata({ | |||||||||||||||||||
| 37 | 'Comment' => { | ||||||||||||||||||||
| 38 | callback => \&parseComment, | ||||||||||||||||||||
| 39 | attribute => 'Comment', | ||||||||||||||||||||
| 40 | lineending => '#pop', | ||||||||||||||||||||
| 41 | }, | ||||||||||||||||||||
| 42 | 'ContrSeq' => { | ||||||||||||||||||||
| 43 | callback => \&parseContrSeq, | ||||||||||||||||||||
| 44 | attribute => 'Keyword', | ||||||||||||||||||||
| 45 | lineending => '#pop', | ||||||||||||||||||||
| 46 | }, | ||||||||||||||||||||
| 47 | 'Environment' => { | ||||||||||||||||||||
| 48 | callback => \&parseEnvironment, | ||||||||||||||||||||
| 49 | attribute => 'Environment', | ||||||||||||||||||||
| 50 | }, | ||||||||||||||||||||
| 51 | 'FindEnvironment' => { | ||||||||||||||||||||
| 52 | callback => \&parseFindEnvironment, | ||||||||||||||||||||
| 53 | attribute => 'Normal Text', | ||||||||||||||||||||
| 54 | }, | ||||||||||||||||||||
| 55 | 'Label' => { | ||||||||||||||||||||
| 56 | callback => \&parseLabel, | ||||||||||||||||||||
| 57 | attribute => 'Normal Text', | ||||||||||||||||||||
| 58 | lineending => '#pop#pop', | ||||||||||||||||||||
| 59 | fallthrough => '#pop#pop', | ||||||||||||||||||||
| 60 | }, | ||||||||||||||||||||
| 61 | 'MathContrSeq' => { | ||||||||||||||||||||
| 62 | callback => \&parseMathContrSeq, | ||||||||||||||||||||
| 63 | attribute => 'Keyword Mathmode', | ||||||||||||||||||||
| 64 | lineending => '#pop', | ||||||||||||||||||||
| 65 | }, | ||||||||||||||||||||
| 66 | 'MathEnv' => { | ||||||||||||||||||||
| 67 | callback => \&parseMathEnv, | ||||||||||||||||||||
| 68 | attribute => 'Environment', | ||||||||||||||||||||
| 69 | }, | ||||||||||||||||||||
| 70 | 'MathFindEnd' => { | ||||||||||||||||||||
| 71 | callback => \&parseMathFindEnd, | ||||||||||||||||||||
| 72 | attribute => 'Normal Text', | ||||||||||||||||||||
| 73 | lineending => '#pop', | ||||||||||||||||||||
| 74 | fallthrough => '#pop', | ||||||||||||||||||||
| 75 | }, | ||||||||||||||||||||
| 76 | 'MathMode' => { | ||||||||||||||||||||
| 77 | callback => \&parseMathMode, | ||||||||||||||||||||
| 78 | attribute => 'Math', | ||||||||||||||||||||
| 79 | }, | ||||||||||||||||||||
| 80 | 'MathModeEnv' => { | ||||||||||||||||||||
| 81 | callback => \&parseMathModeEnv, | ||||||||||||||||||||
| 82 | attribute => 'Math', | ||||||||||||||||||||
| 83 | }, | ||||||||||||||||||||
| 84 | 'Normal Text' => { | ||||||||||||||||||||
| 85 | callback => \&parseNormalText, | ||||||||||||||||||||
| 86 | attribute => 'Normal Text', | ||||||||||||||||||||
| 87 | }, | ||||||||||||||||||||
| 88 | 'ToEndOfLine' => { | ||||||||||||||||||||
| 89 | callback => \&parseToEndOfLine, | ||||||||||||||||||||
| 90 | attribute => 'Normal Text', | ||||||||||||||||||||
| 91 | lineending => '#pop', | ||||||||||||||||||||
| 92 | }, | ||||||||||||||||||||
| 93 | 'Verb' => { | ||||||||||||||||||||
| 94 | callback => \&parseVerb, | ||||||||||||||||||||
| 95 | attribute => 'Verbatim', | ||||||||||||||||||||
| 96 | lineending => '#pop', | ||||||||||||||||||||
| 97 | fallthrough => '#pop', | ||||||||||||||||||||
| 98 | }, | ||||||||||||||||||||
| 99 | 'VerbFindEnd' => { | ||||||||||||||||||||
| 100 | callback => \&parseVerbFindEnd, | ||||||||||||||||||||
| 101 | attribute => 'Normal Text', | ||||||||||||||||||||
| 102 | lineending => '#pop', | ||||||||||||||||||||
| 103 | fallthrough => '#pop', | ||||||||||||||||||||
| 104 | }, | ||||||||||||||||||||
| 105 | 'Verbatim' => { | ||||||||||||||||||||
| 106 | callback => \&parseVerbatim, | ||||||||||||||||||||
| 107 | attribute => 'Verbatim', | ||||||||||||||||||||
| 108 | }, | ||||||||||||||||||||
| 109 | 'VerbatimEnv' => { | ||||||||||||||||||||
| 110 | callback => \&parseVerbatimEnv, | ||||||||||||||||||||
| 111 | attribute => 'Environment', | ||||||||||||||||||||
| 112 | }, | ||||||||||||||||||||
| 113 | }); | ||||||||||||||||||||
| 114 | 2 | $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); | |||||||||||||||||||
| 115 | 2 | $self->basecontext('Normal Text'); | |||||||||||||||||||
| 116 | 2 | $self->keywordscase(1); | |||||||||||||||||||
| 117 | 2 | $self->initialize; | |||||||||||||||||||
| 118 | 2 | bless ($self, $class); | |||||||||||||||||||
| 119 | 2 | return $self; | |||||||||||||||||||
| 120 | } | ||||||||||||||||||||
| 121 | |||||||||||||||||||||
| 122 | sub language { | ||||||||||||||||||||
| 123 | 0 | ▶ | return 'LaTeX'; | ||||||||||||||||||
|
Subroutine
language: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 124 | } | ||||||||||||||||||||
| 125 | |||||||||||||||||||||
| 126 | sub parseComment { | ||||||||||||||||||||
| 127 | 386 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseComment: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 128 | 386 | return 0; | |||||||||||||||||||
| 129 | }; | ||||||||||||||||||||
| 130 | |||||||||||||||||||||
| 131 | sub parseContrSeq { | ||||||||||||||||||||
| 132 | 12 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseContrSeq: called CC=5 SCAR=16.6
Pod
undocumented
| |||||||||||||||||||||
| 133 | # String => 'verb*' | ||||||||||||||||||||
| 134 | # attribute => 'Keyword' | ||||||||||||||||||||
| 135 | # context => 'Verb' | ||||||||||||||||||||
| 136 | # type => 'StringDetect' | ||||||||||||||||||||
| 137 | 12 | ▶ | if ($self->testStringDetect($text, 'verb*', 0, 0, 0, undef, 0, 'Verb', 'Keyword')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 138 | 0 | return 1 | |||||||||||||||||||
| 139 | } | ||||||||||||||||||||
| 140 | # String => 'verb' | ||||||||||||||||||||
| 141 | # attribute => 'Keyword' | ||||||||||||||||||||
| 142 | # context => 'Verb' | ||||||||||||||||||||
| 143 | # type => 'StringDetect' | ||||||||||||||||||||
| 144 | 12 | ▶ | if ($self->testStringDetect($text, 'verb', 0, 0, 0, undef, 0, 'Verb', 'Keyword')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 145 | 2 | return 1 | |||||||||||||||||||
| 146 | } | ||||||||||||||||||||
| 147 | # String => '[a-zA-Z]+' | ||||||||||||||||||||
| 148 | # attribute => 'Keyword' | ||||||||||||||||||||
| 149 | # context => '#pop' | ||||||||||||||||||||
| 150 | # type => 'RegExpr' | ||||||||||||||||||||
| 151 | 10 | ▶ | if ($self->testRegExpr($text, '[a-zA-Z]+', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 152 | 2 | return 1 | |||||||||||||||||||
| 153 | } | ||||||||||||||||||||
| 154 | # String => '[^a-zA-Z]' | ||||||||||||||||||||
| 155 | # attribute => 'Keyword' | ||||||||||||||||||||
| 156 | # context => '#pop' | ||||||||||||||||||||
| 157 | # type => 'RegExpr' | ||||||||||||||||||||
| 158 | 8 | ▶ | if ($self->testRegExpr($text, '[^a-zA-Z]', 0, 0, 0, undef, 0, '#pop', 'Keyword')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 159 | 8 | return 1 | |||||||||||||||||||
| 160 | } | ||||||||||||||||||||
| 161 | 0 | return 0; | |||||||||||||||||||
| 162 | }; | ||||||||||||||||||||
| 163 | |||||||||||||||||||||
| 164 | sub parseEnvironment { | ||||||||||||||||||||
| 165 | 130 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseEnvironment: called CC=5 SCAR=16.2
Pod
undocumented
| |||||||||||||||||||||
| 166 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 167 | # char => '}' | ||||||||||||||||||||
| 168 | # context => '#pop#pop' | ||||||||||||||||||||
| 169 | # type => 'DetectChar' | ||||||||||||||||||||
| 170 | 130 | ▶ | if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 171 | 4 | return 1 | |||||||||||||||||||
| 172 | } | ||||||||||||||||||||
| 173 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 174 | # char => ']' | ||||||||||||||||||||
| 175 | # context => '#pop#pop' | ||||||||||||||||||||
| 176 | # type => 'DetectChar' | ||||||||||||||||||||
| 177 | 126 | ▶ | if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop#pop', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 178 | 0 | return 1 | |||||||||||||||||||
| 179 | } | ||||||||||||||||||||
| 180 | # String => '(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\*?' | ||||||||||||||||||||
| 181 | # attribute => 'Environment' | ||||||||||||||||||||
| 182 | # context => 'VerbatimEnv' | ||||||||||||||||||||
| 183 | # type => 'RegExpr' | ||||||||||||||||||||
| 184 | 126 | ▶ | if ($self->testRegExpr($text, '(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\\*?', 0, 0, 0, undef, 0, 'VerbatimEnv', 'Environment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 185 | 6 | return 1 | |||||||||||||||||||
| 186 | } | ||||||||||||||||||||
| 187 | # String => '(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\*?' | ||||||||||||||||||||
| 188 | # attribute => 'Environment' | ||||||||||||||||||||
| 189 | # context => 'MathEnv' | ||||||||||||||||||||
| 190 | # type => 'RegExpr' | ||||||||||||||||||||
| 191 | 120 | ▶ | if ($self->testRegExpr($text, '(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\*?', 0, 0, 0, undef, 0, 'MathEnv', 'Environment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 192 | 4 | return 1 | |||||||||||||||||||
| 193 | } | ||||||||||||||||||||
| 194 | 116 | return 0; | |||||||||||||||||||
| 195 | }; | ||||||||||||||||||||
| 196 | |||||||||||||||||||||
| 197 | sub parseFindEnvironment { | ||||||||||||||||||||
| 198 | 14 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseFindEnvironment: called CC=3 SCAR=16.0
Pod
undocumented
| |||||||||||||||||||||
| 199 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 200 | # char => '{' | ||||||||||||||||||||
| 201 | # context => 'Environment' | ||||||||||||||||||||
| 202 | # type => 'DetectChar' | ||||||||||||||||||||
| 203 | 14 | ▶ | if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'Environment', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 204 | 14 | return 1 | |||||||||||||||||||
| 205 | } | ||||||||||||||||||||
| 206 | # String => '\S' | ||||||||||||||||||||
| 207 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 208 | # context => '#pop' | ||||||||||||||||||||
| 209 | # type => 'RegExpr' | ||||||||||||||||||||
| 210 | 0 | ▶ | if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 211 | 0 | return 1 | |||||||||||||||||||
| 212 | } | ||||||||||||||||||||
| 213 | 0 | return 0; | |||||||||||||||||||
| 214 | }; | ||||||||||||||||||||
| 215 | |||||||||||||||||||||
| 216 | sub parseLabel { | ||||||||||||||||||||
| 217 | 18 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseLabel: called CC=4 SCAR=14.0
Pod
undocumented
| |||||||||||||||||||||
| 218 | # String => '\s*\{\s*' | ||||||||||||||||||||
| 219 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 220 | # context => '#stay' | ||||||||||||||||||||
| 221 | # type => 'RegExpr' | ||||||||||||||||||||
| 222 | 18 | ▶ | if ($self->testRegExpr($text, '\\s*\\{\\s*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 223 | 6 | return 1 | |||||||||||||||||||
| 224 | } | ||||||||||||||||||||
| 225 | # String => '[^\}\{]+' | ||||||||||||||||||||
| 226 | # attribute => 'Environment' | ||||||||||||||||||||
| 227 | # context => '#stay' | ||||||||||||||||||||
| 228 | # type => 'RegExpr' | ||||||||||||||||||||
| 229 | 12 | ▶ | if ($self->testRegExpr($text, '[^\\}\\{]+', 0, 0, 0, undef, 0, '#stay', 'Environment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 230 | 6 | return 1 | |||||||||||||||||||
| 231 | } | ||||||||||||||||||||
| 232 | # String => '\s*\}\s*' | ||||||||||||||||||||
| 233 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 234 | # context => '#pop' | ||||||||||||||||||||
| 235 | # type => 'RegExpr' | ||||||||||||||||||||
| 236 | 6 | ▶ | if ($self->testRegExpr($text, '\\s*\\}\\s*', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 237 | 6 | return 1 | |||||||||||||||||||
| 238 | } | ||||||||||||||||||||
| 239 | 0 | return 0; | |||||||||||||||||||
| 240 | }; | ||||||||||||||||||||
| 241 | |||||||||||||||||||||
| 242 | sub parseMathContrSeq { | ||||||||||||||||||||
| 243 | 16 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseMathContrSeq: called CC=3 SCAR=11.2
Pod
undocumented
| |||||||||||||||||||||
| 244 | # String => '[a-zA-Z]+' | ||||||||||||||||||||
| 245 | # attribute => 'Keyword Mathmode' | ||||||||||||||||||||
| 246 | # context => '#pop' | ||||||||||||||||||||
| 247 | # type => 'RegExpr' | ||||||||||||||||||||
| 248 | 16 | ▶ | if ($self->testRegExpr($text, '[a-zA-Z]+', 0, 0, 0, undef, 0, '#pop', 'Keyword Mathmode')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 249 | 14 | return 1 | |||||||||||||||||||
| 250 | } | ||||||||||||||||||||
| 251 | # String => '[^a-zA-Z]' | ||||||||||||||||||||
| 252 | # attribute => 'Keyword Mathmode' | ||||||||||||||||||||
| 253 | # context => '#pop' | ||||||||||||||||||||
| 254 | # type => 'RegExpr' | ||||||||||||||||||||
| 255 | 2 | ▶ | if ($self->testRegExpr($text, '[^a-zA-Z]', 0, 0, 0, undef, 0, '#pop', 'Keyword Mathmode')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 256 | 2 | return 1 | |||||||||||||||||||
| 257 | } | ||||||||||||||||||||
| 258 | 0 | return 0; | |||||||||||||||||||
| 259 | }; | ||||||||||||||||||||
| 260 | |||||||||||||||||||||
| 261 | sub parseMathEnv { | ||||||||||||||||||||
| 262 | 4 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseMathEnv: called CC=3 SCAR=16.0
Pod
undocumented
| |||||||||||||||||||||
| 263 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 264 | # char => '}' | ||||||||||||||||||||
| 265 | # context => 'MathModeEnv' | ||||||||||||||||||||
| 266 | # type => 'DetectChar' | ||||||||||||||||||||
| 267 | 4 | ▶ | if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'MathModeEnv', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 268 | 4 | return 1 | |||||||||||||||||||
| 269 | } | ||||||||||||||||||||
| 270 | # String => '\S' | ||||||||||||||||||||
| 271 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 272 | # context => '#pop' | ||||||||||||||||||||
| 273 | # type => 'RegExpr' | ||||||||||||||||||||
| 274 | 0 | ▶ | if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 275 | 0 | return 1 | |||||||||||||||||||
| 276 | } | ||||||||||||||||||||
| 277 | 0 | return 0; | |||||||||||||||||||
| 278 | }; | ||||||||||||||||||||
| 279 | |||||||||||||||||||||
| 280 | sub parseMathFindEnd { | ||||||||||||||||||||
| 281 | 12 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseMathFindEnd: called CC=5 SCAR=16.6
Pod
undocumented
| |||||||||||||||||||||
| 282 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 283 | # char => '{' | ||||||||||||||||||||
| 284 | # context => '#stay' | ||||||||||||||||||||
| 285 | # type => 'DetectChar' | ||||||||||||||||||||
| 286 | 12 | ▶ | if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 287 | 4 | return 1 | |||||||||||||||||||
| 288 | } | ||||||||||||||||||||
| 289 | # String => '[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\*?' | ||||||||||||||||||||
| 290 | # attribute => 'Environment' | ||||||||||||||||||||
| 291 | # context => '#stay' | ||||||||||||||||||||
| 292 | # type => 'RegExpr' | ||||||||||||||||||||
| 293 | 8 | ▶ | if ($self->testRegExpr($text, '[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\*?', 0, 0, 0, undef, 0, '#stay', 'Environment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 294 | 4 | return 1 | |||||||||||||||||||
| 295 | } | ||||||||||||||||||||
| 296 | # type => 'DetectSpaces' | ||||||||||||||||||||
| 297 | 4 | ▶ | if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 298 | 0 | return 1 | |||||||||||||||||||
| 299 | } | ||||||||||||||||||||
| 300 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 301 | # char => '}' | ||||||||||||||||||||
| 302 | # context => '#pop#pop#pop#pop#pop' | ||||||||||||||||||||
| 303 | # endRegion => 'block' | ||||||||||||||||||||
| 304 | # type => 'DetectChar' | ||||||||||||||||||||
| 305 | 4 | ▶ | if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop#pop#pop', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 306 | 4 | return 1 | |||||||||||||||||||
| 307 | } | ||||||||||||||||||||
| 308 | 0 | return 0; | |||||||||||||||||||
| 309 | }; | ||||||||||||||||||||
| 310 | |||||||||||||||||||||
| 311 | sub parseMathMode { | ||||||||||||||||||||
| 312 | 230 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseMathMode: called CC=11 SCAR=24.1
Pod
undocumented
| |||||||||||||||||||||
| 313 | # attribute => 'Math' | ||||||||||||||||||||
| 314 | # char => '\' | ||||||||||||||||||||
| 315 | # char1 => ']' | ||||||||||||||||||||
| 316 | # context => '#pop' | ||||||||||||||||||||
| 317 | # endRegion => 'mathMode' | ||||||||||||||||||||
| 318 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 319 | 230 | ▶ | if ($self->testDetect2Chars($text, '\\', ']', 0, 0, 0, undef, 0, '#pop', 'Math')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 320 | 2 | return 1 | |||||||||||||||||||
| 321 | } | ||||||||||||||||||||
| 322 | # attribute => 'Math' | ||||||||||||||||||||
| 323 | # char => '\' | ||||||||||||||||||||
| 324 | # char1 => ')' | ||||||||||||||||||||
| 325 | # context => '#pop' | ||||||||||||||||||||
| 326 | # endRegion => 'mathMode' | ||||||||||||||||||||
| 327 | # type => 'Detect2Chars' | ||||||||||||||||||||
| 328 | 228 | ▶ | if ($self->testDetect2Chars($text, '\\', ')', 0, 0, 0, undef, 0, '#pop', 'Math')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 329 | 2 | return 1 | |||||||||||||||||||
| 330 | } | ||||||||||||||||||||
| 331 | # String => '\\begin(?=[^a-zA-Z])' | ||||||||||||||||||||
| 332 | # attribute => 'Keyword Mathmode' | ||||||||||||||||||||
| 333 | # beginRegion => 'block' | ||||||||||||||||||||
| 334 | # context => '#stay' | ||||||||||||||||||||
| 335 | # type => 'RegExpr' | ||||||||||||||||||||
| 336 | 226 | ▶ | if ($self->testRegExpr($text, '\\\\begin(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Keyword Mathmode')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 337 | 2 | return 1 | |||||||||||||||||||
| 338 | } | ||||||||||||||||||||
| 339 | # String => '\\end(?=[^a-zA-Z])' | ||||||||||||||||||||
| 340 | # attribute => 'Keyword Mathmode' | ||||||||||||||||||||
| 341 | # context => '#stay' | ||||||||||||||||||||
| 342 | # endRegion => 'block' | ||||||||||||||||||||
| 343 | # type => 'RegExpr' | ||||||||||||||||||||
| 344 | 224 | ▶ | if ($self->testRegExpr($text, '\\\\end(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Keyword Mathmode')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 345 | 2 | return 1 | |||||||||||||||||||
| 346 | } | ||||||||||||||||||||
| 347 | # attribute => 'Keyword Mathmode' | ||||||||||||||||||||
| 348 | # char => '\' | ||||||||||||||||||||
| 349 | # context => 'MathContrSeq' | ||||||||||||||||||||
| 350 | # type => 'DetectChar' | ||||||||||||||||||||
| 351 | 222 | ▶ | if ($self->testDetectChar($text, '\\', 0, 0, 0, undef, 0, 'MathContrSeq', 'Keyword Mathmode')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 352 | 6 | return 1 | |||||||||||||||||||
| 353 | } | ||||||||||||||||||||
| 354 | # String => '$$' | ||||||||||||||||||||
| 355 | # attribute => 'Math' | ||||||||||||||||||||
| 356 | # context => '#pop' | ||||||||||||||||||||
| 357 | # endRegion => 'mathMode' | ||||||||||||||||||||
| 358 | # type => 'StringDetect' | ||||||||||||||||||||
| 359 | 216 | ▶ | if ($self->testStringDetect($text, '$$', 0, 0, 0, undef, 0, '#pop', 'Math')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 360 | 2 | return 1 | |||||||||||||||||||
| 361 | } | ||||||||||||||||||||
| 362 | # attribute => 'Math' | ||||||||||||||||||||
| 363 | # char => '$' | ||||||||||||||||||||
| 364 | # context => '#pop' | ||||||||||||||||||||
| 365 | # endRegion => 'mathMode' | ||||||||||||||||||||
| 366 | # type => 'DetectChar' | ||||||||||||||||||||
| 367 | 214 | ▶ | if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, '#pop', 'Math')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 368 | 2 | return 1 | |||||||||||||||||||
| 369 | } | ||||||||||||||||||||
| 370 | # String => '%\s*BEGIN.*$' | ||||||||||||||||||||
| 371 | # attribute => 'Region Marker' | ||||||||||||||||||||
| 372 | # beginRegion => 'regionMarker' | ||||||||||||||||||||
| 373 | # context => '#stay' | ||||||||||||||||||||
| 374 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 375 | # type => 'RegExpr' | ||||||||||||||||||||
| 376 | 212 | ▶ | if ($self->testRegExpr($text, '%\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 377 | 0 | return 1 | |||||||||||||||||||
| 378 | } | ||||||||||||||||||||
| 379 | # String => '%\s*END.*$' | ||||||||||||||||||||
| 380 | # attribute => 'Region Marker' | ||||||||||||||||||||
| 381 | # context => '#stay' | ||||||||||||||||||||
| 382 | # endRegion => 'regionMarker' | ||||||||||||||||||||
| 383 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 384 | # type => 'RegExpr' | ||||||||||||||||||||
| 385 | 212 | ▶ | if ($self->testRegExpr($text, '%\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 386 | 0 | return 1 | |||||||||||||||||||
| 387 | } | ||||||||||||||||||||
| 388 | # attribute => 'Comment' | ||||||||||||||||||||
| 389 | # char => '%' | ||||||||||||||||||||
| 390 | # context => 'Comment' | ||||||||||||||||||||
| 391 | # type => 'DetectChar' | ||||||||||||||||||||
| 392 | 212 | ▶ | if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 393 | 2 | return 1 | |||||||||||||||||||
| 394 | } | ||||||||||||||||||||
| 395 | 210 | return 0; | |||||||||||||||||||
| 396 | }; | ||||||||||||||||||||
| 397 | |||||||||||||||||||||
| 398 | sub parseMathModeEnv { | ||||||||||||||||||||
| 399 | 112 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseMathModeEnv: called CC=12 SCAR=26.8
Pod
undocumented
| |||||||||||||||||||||
| 400 | # String => '\\end(?=\s*\{\s*[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\*?\s*\})' | ||||||||||||||||||||
| 401 | # attribute => 'Structure' | ||||||||||||||||||||
| 402 | # context => 'MathFindEnd' | ||||||||||||||||||||
| 403 | # type => 'RegExpr' | ||||||||||||||||||||
| 404 | 112 | ▶ | if ($self->testRegExpr($text, '\\\\end(?=\\s*\\{\\s*[a-zA-Z]*(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\*?\\s*\\})', 0, 0, 0, undef, 0, 'MathFindEnd', 'Structure')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 405 | 4 | return 1 | |||||||||||||||||||
| 406 | } | ||||||||||||||||||||
| 407 | # String => '\\begin(?=[^a-zA-Z])' | ||||||||||||||||||||
| 408 | # attribute => 'Keyword Mathmode' | ||||||||||||||||||||
| 409 | # beginRegion => 'block' | ||||||||||||||||||||
| 410 | # context => '#stay' | ||||||||||||||||||||
| 411 | # type => 'RegExpr' | ||||||||||||||||||||
| 412 | 108 | ▶ | if ($self->testRegExpr($text, '\\\\begin(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Keyword Mathmode')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 413 | 4 | return 1 | |||||||||||||||||||
| 414 | } | ||||||||||||||||||||
| 415 | # String => '\\end(?=[^a-zA-Z])' | ||||||||||||||||||||
| 416 | # attribute => 'Keyword Mathmode' | ||||||||||||||||||||
| 417 | # context => '#stay' | ||||||||||||||||||||
| 418 | # endRegion => 'block' | ||||||||||||||||||||
| 419 | # type => 'RegExpr' | ||||||||||||||||||||
| 420 | 104 | ▶ | if ($self->testRegExpr($text, '\\\\end(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Keyword Mathmode')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 421 | 4 | return 1 | |||||||||||||||||||
| 422 | } | ||||||||||||||||||||
| 423 | # String => '\(' | ||||||||||||||||||||
| 424 | # attribute => 'Math' | ||||||||||||||||||||
| 425 | # beginRegion => 'mathMode' | ||||||||||||||||||||
| 426 | # context => 'MathMode' | ||||||||||||||||||||
| 427 | # type => 'StringDetect' | ||||||||||||||||||||
| 428 | 100 | ▶ | if ($self->testStringDetect($text, '\\(', 0, 0, 0, undef, 0, 'MathMode', 'Math')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 429 | 0 | return 1 | |||||||||||||||||||
| 430 | } | ||||||||||||||||||||
| 431 | # String => '\[' | ||||||||||||||||||||
| 432 | # attribute => 'Math' | ||||||||||||||||||||
| 433 | # beginRegion => 'mathMode' | ||||||||||||||||||||
| 434 | # context => 'MathMode' | ||||||||||||||||||||
| 435 | # type => 'StringDetect' | ||||||||||||||||||||
| 436 | 100 | ▶ | if ($self->testStringDetect($text, '\\[', 0, 0, 0, undef, 0, 'MathMode', 'Math')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 437 | 0 | return 1 | |||||||||||||||||||
| 438 | } | ||||||||||||||||||||
| 439 | # attribute => 'Keyword Mathmode' | ||||||||||||||||||||
| 440 | # char => '\' | ||||||||||||||||||||
| 441 | # context => 'MathContrSeq' | ||||||||||||||||||||
| 442 | # type => 'DetectChar' | ||||||||||||||||||||
| 443 | 100 | ▶ | if ($self->testDetectChar($text, '\\', 0, 0, 0, undef, 0, 'MathContrSeq', 'Keyword Mathmode')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 444 | 10 | return 1 | |||||||||||||||||||
| 445 | } | ||||||||||||||||||||
| 446 | # String => '$$' | ||||||||||||||||||||
| 447 | # attribute => 'Math' | ||||||||||||||||||||
| 448 | # beginRegion => 'mathMode' | ||||||||||||||||||||
| 449 | # context => 'MathMode' | ||||||||||||||||||||
| 450 | # type => 'StringDetect' | ||||||||||||||||||||
| 451 | 90 | ▶ | if ($self->testStringDetect($text, '$$', 0, 0, 0, undef, 0, 'MathMode', 'Math')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 452 | 0 | return 1 | |||||||||||||||||||
| 453 | } | ||||||||||||||||||||
| 454 | # attribute => 'Math' | ||||||||||||||||||||
| 455 | # beginRegion => 'mathMode' | ||||||||||||||||||||
| 456 | # char => '$' | ||||||||||||||||||||
| 457 | # context => 'MathMode' | ||||||||||||||||||||
| 458 | # type => 'DetectChar' | ||||||||||||||||||||
| 459 | 90 | ▶ | if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, 'MathMode', 'Math')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 460 | 0 | return 1 | |||||||||||||||||||
| 461 | } | ||||||||||||||||||||
| 462 | # String => '%\s*BEGIN.*$' | ||||||||||||||||||||
| 463 | # attribute => 'Region Marker' | ||||||||||||||||||||
| 464 | # beginRegion => 'regionMarker' | ||||||||||||||||||||
| 465 | # context => '#stay' | ||||||||||||||||||||
| 466 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 467 | # type => 'RegExpr' | ||||||||||||||||||||
| 468 | 90 | ▶ | if ($self->testRegExpr($text, '%\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 469 | 0 | return 1 | |||||||||||||||||||
| 470 | } | ||||||||||||||||||||
| 471 | # String => '%\s*END.*$' | ||||||||||||||||||||
| 472 | # attribute => 'Region Marker' | ||||||||||||||||||||
| 473 | # context => '#stay' | ||||||||||||||||||||
| 474 | # endRegion => 'regionMarker' | ||||||||||||||||||||
| 475 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 476 | # type => 'RegExpr' | ||||||||||||||||||||
| 477 | 90 | ▶ | if ($self->testRegExpr($text, '%\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 478 | 0 | return 1 | |||||||||||||||||||
| 479 | } | ||||||||||||||||||||
| 480 | # attribute => 'Comment' | ||||||||||||||||||||
| 481 | # char => '%' | ||||||||||||||||||||
| 482 | # context => 'Comment' | ||||||||||||||||||||
| 483 | # type => 'DetectChar' | ||||||||||||||||||||
| 484 | 90 | ▶ | if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 485 | 2 | return 1 | |||||||||||||||||||
| 486 | } | ||||||||||||||||||||
| 487 | 88 | return 0; | |||||||||||||||||||
| 488 | }; | ||||||||||||||||||||
| 489 | |||||||||||||||||||||
| 490 | sub parseNormalText { | ||||||||||||||||||||
| 491 | 282 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseNormalText: called CC=15 SCAR=27.2
Pod
undocumented
| |||||||||||||||||||||
| 492 | # String => '\\begin(?=[^a-zA-Z])' | ||||||||||||||||||||
| 493 | # attribute => 'Structure' | ||||||||||||||||||||
| 494 | # beginRegion => 'block' | ||||||||||||||||||||
| 495 | # context => 'FindEnvironment' | ||||||||||||||||||||
| 496 | # type => 'RegExpr' | ||||||||||||||||||||
| 497 | 282 | ▶ | if ($self->testRegExpr($text, '\\\\begin(?=[^a-zA-Z])', 0, 0, 0, undef, 0, 'FindEnvironment', 'Structure')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 498 | 12 | return 1 | |||||||||||||||||||
| 499 | } | ||||||||||||||||||||
| 500 | # String => '\\end(?=[^a-zA-Z])' | ||||||||||||||||||||
| 501 | # attribute => 'Structure' | ||||||||||||||||||||
| 502 | # context => 'FindEnvironment' | ||||||||||||||||||||
| 503 | # endRegion => 'block' | ||||||||||||||||||||
| 504 | # type => 'RegExpr' | ||||||||||||||||||||
| 505 | 270 | ▶ | if ($self->testRegExpr($text, '\\\\end(?=[^a-zA-Z])', 0, 0, 0, undef, 0, 'FindEnvironment', 'Structure')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 506 | 2 | return 1 | |||||||||||||||||||
| 507 | } | ||||||||||||||||||||
| 508 | # String => '\\(label|pageref|ref|cite)(?=[^a-zA-Z])' | ||||||||||||||||||||
| 509 | # attribute => 'Structure' | ||||||||||||||||||||
| 510 | # context => 'Label' | ||||||||||||||||||||
| 511 | # type => 'RegExpr' | ||||||||||||||||||||
| 512 | 268 | ▶ | if ($self->testRegExpr($text, '\\\\(label|pageref|ref|cite)(?=[^a-zA-Z])', 0, 0, 0, undef, 0, 'Label', 'Structure')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 513 | 6 | return 1 | |||||||||||||||||||
| 514 | } | ||||||||||||||||||||
| 515 | # String => '\\(part|chapter|section|subsection|subsubsection|paragraph|subparagraph)(?=[^a-zA-Z])' | ||||||||||||||||||||
| 516 | # attribute => 'Structure' | ||||||||||||||||||||
| 517 | # context => '#stay' | ||||||||||||||||||||
| 518 | # type => 'RegExpr' | ||||||||||||||||||||
| 519 | 262 | ▶ | if ($self->testRegExpr($text, '\\\\(part|chapter|section|subsection|subsubsection|paragraph|subparagraph)(?=[^a-zA-Z])', 0, 0, 0, undef, 0, '#stay', 'Structure')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 520 | 2 | return 1 | |||||||||||||||||||
| 521 | } | ||||||||||||||||||||
| 522 | # String => '\renewcommand' | ||||||||||||||||||||
| 523 | # attribute => 'Keyword' | ||||||||||||||||||||
| 524 | # context => 'ToEndOfLine' | ||||||||||||||||||||
| 525 | # type => 'StringDetect' | ||||||||||||||||||||
| 526 | 260 | ▶ | if ($self->testStringDetect($text, '\\renewcommand', 0, 0, 0, undef, 0, 'ToEndOfLine', 'Keyword')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 527 | 0 | return 1 | |||||||||||||||||||
| 528 | } | ||||||||||||||||||||
| 529 | # String => '\newcommand' | ||||||||||||||||||||
| 530 | # attribute => 'Keyword' | ||||||||||||||||||||
| 531 | # context => 'ToEndOfLine' | ||||||||||||||||||||
| 532 | # type => 'StringDetect' | ||||||||||||||||||||
| 533 | 260 | ▶ | if ($self->testStringDetect($text, '\\newcommand', 0, 0, 0, undef, 0, 'ToEndOfLine', 'Keyword')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 534 | 2 | return 1 | |||||||||||||||||||
| 535 | } | ||||||||||||||||||||
| 536 | # String => '\(' | ||||||||||||||||||||
| 537 | # attribute => 'Math' | ||||||||||||||||||||
| 538 | # beginRegion => 'mathMode' | ||||||||||||||||||||
| 539 | # context => 'MathMode' | ||||||||||||||||||||
| 540 | # type => 'StringDetect' | ||||||||||||||||||||
| 541 | 258 | ▶ | if ($self->testStringDetect($text, '\\(', 0, 0, 0, undef, 0, 'MathMode', 'Math')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 542 | 2 | return 1 | |||||||||||||||||||
| 543 | } | ||||||||||||||||||||
| 544 | # String => '\[' | ||||||||||||||||||||
| 545 | # attribute => 'Math' | ||||||||||||||||||||
| 546 | # beginRegion => 'mathMode' | ||||||||||||||||||||
| 547 | # context => 'MathMode' | ||||||||||||||||||||
| 548 | # type => 'StringDetect' | ||||||||||||||||||||
| 549 | 256 | ▶ | if ($self->testStringDetect($text, '\\[', 0, 0, 0, undef, 0, 'MathMode', 'Math')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 550 | 2 | return 1 | |||||||||||||||||||
| 551 | } | ||||||||||||||||||||
| 552 | # attribute => 'Keyword' | ||||||||||||||||||||
| 553 | # char => '\' | ||||||||||||||||||||
| 554 | # context => 'ContrSeq' | ||||||||||||||||||||
| 555 | # type => 'DetectChar' | ||||||||||||||||||||
| 556 | 254 | ▶ | if ($self->testDetectChar($text, '\\', 0, 0, 0, undef, 0, 'ContrSeq', 'Keyword')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 557 | 10 | return 1 | |||||||||||||||||||
| 558 | } | ||||||||||||||||||||
| 559 | # String => '$$' | ||||||||||||||||||||
| 560 | # attribute => 'Math' | ||||||||||||||||||||
| 561 | # beginRegion => 'mathMode' | ||||||||||||||||||||
| 562 | # context => 'MathMode' | ||||||||||||||||||||
| 563 | # type => 'StringDetect' | ||||||||||||||||||||
| 564 | 244 | ▶ | if ($self->testStringDetect($text, '$$', 0, 0, 0, undef, 0, 'MathMode', 'Math')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 565 | 2 | return 1 | |||||||||||||||||||
| 566 | } | ||||||||||||||||||||
| 567 | # attribute => 'Math' | ||||||||||||||||||||
| 568 | # beginRegion => 'mathMode' | ||||||||||||||||||||
| 569 | # char => '$' | ||||||||||||||||||||
| 570 | # context => 'MathMode' | ||||||||||||||||||||
| 571 | # type => 'DetectChar' | ||||||||||||||||||||
| 572 | 242 | ▶ | if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, 'MathMode', 'Math')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 573 | 2 | return 1 | |||||||||||||||||||
| 574 | } | ||||||||||||||||||||
| 575 | # String => '%\s*BEGIN.*$' | ||||||||||||||||||||
| 576 | # attribute => 'Region Marker' | ||||||||||||||||||||
| 577 | # beginRegion => 'regionMarker' | ||||||||||||||||||||
| 578 | # context => '#stay' | ||||||||||||||||||||
| 579 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 580 | # type => 'RegExpr' | ||||||||||||||||||||
| 581 | 240 | ▶ | if ($self->testRegExpr($text, '%\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 582 | 0 | return 1 | |||||||||||||||||||
| 583 | } | ||||||||||||||||||||
| 584 | # String => '%\s*END.*$' | ||||||||||||||||||||
| 585 | # attribute => 'Region Marker' | ||||||||||||||||||||
| 586 | # context => '#stay' | ||||||||||||||||||||
| 587 | # endRegion => 'regionMarker' | ||||||||||||||||||||
| 588 | # firstNonSpace => 'true' | ||||||||||||||||||||
| 589 | # type => 'RegExpr' | ||||||||||||||||||||
| 590 | 240 | ▶ | if ($self->testRegExpr($text, '%\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 591 | 0 | return 1 | |||||||||||||||||||
| 592 | } | ||||||||||||||||||||
| 593 | # attribute => 'Comment' | ||||||||||||||||||||
| 594 | # char => '%' | ||||||||||||||||||||
| 595 | # context => 'Comment' | ||||||||||||||||||||
| 596 | # type => 'DetectChar' | ||||||||||||||||||||
| 597 | 240 | ▶ | if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 598 | 14 | return 1 | |||||||||||||||||||
| 599 | } | ||||||||||||||||||||
| 600 | 226 | return 0; | |||||||||||||||||||
| 601 | }; | ||||||||||||||||||||
| 602 | |||||||||||||||||||||
| 603 | sub parseToEndOfLine { | ||||||||||||||||||||
| 604 | 34 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseToEndOfLine: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 605 | 34 | return 0; | |||||||||||||||||||
| 606 | }; | ||||||||||||||||||||
| 607 | |||||||||||||||||||||
| 608 | sub parseVerb { | ||||||||||||||||||||
| 609 | 2 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseVerb: called CC=2 SCAR=7.6
Pod
undocumented
| |||||||||||||||||||||
| 610 | # String => '(.).*\1' | ||||||||||||||||||||
| 611 | # attribute => 'Verbatim' | ||||||||||||||||||||
| 612 | # context => '#pop#pop' | ||||||||||||||||||||
| 613 | # minimal => 'true' | ||||||||||||||||||||
| 614 | # type => 'RegExpr' | ||||||||||||||||||||
| 615 | 2 | ▶ | if ($self->testRegExpr($text, '(.).*?\\1', 0, 0, 0, undef, 0, '#pop#pop', 'Verbatim')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 616 | 0 | return 1 | |||||||||||||||||||
| 617 | } | ||||||||||||||||||||
| 618 | 2 | return 0; | |||||||||||||||||||
| 619 | }; | ||||||||||||||||||||
| 620 | |||||||||||||||||||||
| 621 | sub parseVerbFindEnd { | ||||||||||||||||||||
| 622 | 18 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseVerbFindEnd: called CC=4 SCAR=14.0
Pod
undocumented
| |||||||||||||||||||||
| 623 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 624 | # char => '{' | ||||||||||||||||||||
| 625 | # context => '#stay' | ||||||||||||||||||||
| 626 | # type => 'DetectChar' | ||||||||||||||||||||
| 627 | 18 | ▶ | if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 628 | 6 | return 1 | |||||||||||||||||||
| 629 | } | ||||||||||||||||||||
| 630 | # String => '(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\*?' | ||||||||||||||||||||
| 631 | # attribute => 'Environment' | ||||||||||||||||||||
| 632 | # context => '#stay' | ||||||||||||||||||||
| 633 | # type => 'RegExpr' | ||||||||||||||||||||
| 634 | 12 | ▶ | if ($self->testRegExpr($text, '(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\\*?', 0, 0, 0, undef, 0, '#stay', 'Environment')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 635 | 6 | return 1 | |||||||||||||||||||
| 636 | } | ||||||||||||||||||||
| 637 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 638 | # char => '}' | ||||||||||||||||||||
| 639 | # context => '#pop#pop#pop#pop#pop' | ||||||||||||||||||||
| 640 | # endRegion => 'block' | ||||||||||||||||||||
| 641 | # type => 'DetectChar' | ||||||||||||||||||||
| 642 | 6 | ▶ | if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop#pop#pop', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 643 | 6 | return 1 | |||||||||||||||||||
| 644 | } | ||||||||||||||||||||
| 645 | 0 | return 0; | |||||||||||||||||||
| 646 | }; | ||||||||||||||||||||
| 647 | |||||||||||||||||||||
| 648 | sub parseVerbatim { | ||||||||||||||||||||
| 649 | 264 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseVerbatim: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 650 | # String => '\\end(?=\{(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\*?\})' | ||||||||||||||||||||
| 651 | # attribute => 'Structure' | ||||||||||||||||||||
| 652 | # context => 'VerbFindEnd' | ||||||||||||||||||||
| 653 | # type => 'RegExpr' | ||||||||||||||||||||
| 654 | 264 | ▶ | if ($self->testRegExpr($text, '\\\\end(?=\\{(semiverbatim|verbatim|lstlisting|boxedverbatim|Verbatim)\\*?\\})', 0, 0, 0, undef, 0, 'VerbFindEnd', 'Structure')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 655 | 6 | return 1 | |||||||||||||||||||
| 656 | } | ||||||||||||||||||||
| 657 | 258 | return 0; | |||||||||||||||||||
| 658 | }; | ||||||||||||||||||||
| 659 | |||||||||||||||||||||
| 660 | sub parseVerbatimEnv { | ||||||||||||||||||||
| 661 | 6 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||
|
Subroutine
parseVerbatimEnv: called CC=4 SCAR=19.4
Pod
undocumented
| |||||||||||||||||||||
| 662 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 663 | # char => '*' | ||||||||||||||||||||
| 664 | # context => '#stay' | ||||||||||||||||||||
| 665 | # type => 'DetectChar' | ||||||||||||||||||||
| 666 | 6 | ▶ | if ($self->testDetectChar($text, '*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 667 | 0 | return 1 | |||||||||||||||||||
| 668 | } | ||||||||||||||||||||
| 669 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 670 | # char => '}' | ||||||||||||||||||||
| 671 | # context => 'Verbatim' | ||||||||||||||||||||
| 672 | # type => 'DetectChar' | ||||||||||||||||||||
| 673 | 6 | ▶ | if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'Verbatim', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 674 | 6 | return 1 | |||||||||||||||||||
| 675 | } | ||||||||||||||||||||
| 676 | # String => '\S' | ||||||||||||||||||||
| 677 | # attribute => 'Normal Text' | ||||||||||||||||||||
| 678 | # context => '#pop' | ||||||||||||||||||||
| 679 | # type => 'RegExpr' | ||||||||||||||||||||
| 680 | 0 | ▶ | if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 681 | 0 | return 1 | |||||||||||||||||||
| 682 | } | ||||||||||||||||||||
| 683 | 0 | return 0; | |||||||||||||||||||
| 684 | }; | ||||||||||||||||||||
| 685 | |||||||||||||||||||||
| 686 | |||||||||||||||||||||
| 687 | 1 | 1; | |||||||||||||||||||
| 688 | |||||||||||||||||||||
| 689 | __END__ | ||||||||||||||||||||