| 1 | |||
| 2 | ################################################################################### | ||
| 3 | # | ||
| 4 | # Embperl - Copyright (c) 1997-2008 Gerald Richter / ecos gmbh www.ecos.de | ||
| 5 | # Embperl - Copyright (c) 2008-2015 Gerald Richter | ||
| 6 | # Embperl - Copyright (c) 2015-2023 actevy.io | ||
| 7 | # | ||
| 8 | # You may distribute under the terms of either the GNU General Public | ||
| 9 | # License or the Artistic License, as specified in the Perl README file. | ||
| 10 | # | ||
| 11 | # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR | ||
| 12 | # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | ||
| 13 | # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
| 14 | # | ||
| 15 | |||
| 16 | ################################################################################### | ||
| 17 | |||
| 18 | |||
| 19 | |||
| 20 | package Embperl::Syntax::POD ; | ||
| 21 | |||
| 22 | use Embperl::Syntax (':types') ; | ||
| 23 | use Embperl::Syntax::EmbperlBlocks ; | ||
| 24 | |||
| 25 | use strict ; | ||
| 26 | use vars qw{@ISA %Tags %Format %Escape %Para %ParaItem %ParaTitle %List %Search %SearchInside %ListStart %CDATA %Skip} ; | ||
| 27 | |||
| 28 | |||
| 29 | |||
| 30 | @ISA = qw(Embperl::Syntax::EmbperlBlocks) ; | ||
| 31 | |||
| 32 | |||
| 33 | ################################################################################### | ||
| 34 | # | ||
| 35 | # Methods | ||
| 36 | # | ||
| 37 | ################################################################################### | ||
| 38 | |||
| 39 | # --------------------------------------------------------------------------------- | ||
| 40 | # | ||
| 41 | # Create new Syntax Object | ||
| 42 | # | ||
| 43 | # --------------------------------------------------------------------------------- | ||
| 44 | |||
| 45 | sub new | ||
| 46 | |||
| 47 | { | ||
| 48 | my $self = shift ; | ||
| 49 | |||
| 50 | #$self = Embperl::Syntax::EmbperlBlocks::new ($self, 1) ; | ||
| 51 | $self = Embperl::Syntax::new ($self, 1) ; | ||
| 52 | |||
| 53 | if (!$self -> {-PODTags}) | ||
| 54 | { | ||
| 55 | $self -> {-PODTags} = $self -> CloneHash (\%Search) ; | ||
| 56 | |||
| 57 | $self -> AddToRoot ($self -> {-PODTags}) ; | ||
| 58 | $self -> AddInitCode (undef, '$escmode=0;$_ep_node=%$x%+1;print OUT "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>"; $escmode=15; ', undef) ; | ||
| 59 | #$self -> AddToRoot ({'-defnodetype' => ntypText,}) ; | ||
| 60 | |||
| 61 | |||
| 62 | #$self -> {-PODCmds} = $self -> {-PODTags}{'POD Command'}{'follow'} ; | ||
| 63 | #Init ($self) ; | ||
| 64 | } | ||
| 65 | |||
| 66 | return $self ; | ||
| 67 | } | ||
| 68 | |||
| 69 | # --------------------------------------------------------------------------------- | ||
| 70 | # | ||
| 71 | # Add new POD command | ||
| 72 | # | ||
| 73 | # --------------------------------------------------------------------------------- | ||
| 74 | |||
| 75 | |||
| 76 | sub AddPODCmd | ||
| 77 | |||
| 78 | { | ||
| 79 | my ($self, $cmdname, $name) = @_ ; | ||
| 80 | |||
| 81 | my $ttfollow = $self -> {-PODCmds} ; | ||
| 82 | |||
| 83 | my $tag = $ttfollow -> {$cmdname} = { | ||
| 84 | 'text' => $cmdname, | ||
| 85 | 'nodetype' => ntypStartEndTag, | ||
| 86 | 'cdatatype' => ntypText, | ||
| 87 | 'removespaces' => 72, | ||
| 88 | 'inside' => \%Format, | ||
| 89 | } ; | ||
| 90 | $tag -> {nodename} = $name if ($name) ; | ||
| 91 | |||
| 92 | return $tag ; | ||
| 93 | } | ||
| 94 | |||
| 95 | |||
| 96 | sub AddPODStartEnd | ||
| 97 | |||
| 98 | { | ||
| 99 | my ($self, $start, $end, $name) = @_ ; | ||
| 100 | |||
| 101 | my $ttfollow = $self -> {-PODCmds} ; | ||
| 102 | |||
| 103 | my $stag = $ttfollow -> {$start} = { | ||
| 104 | 'text' => $start, | ||
| 105 | 'nodetype' => ntypStartTag, | ||
| 106 | 'cdatatype' => 0, | ||
| 107 | 'removespaces' => 72, | ||
| 108 | } ; | ||
| 109 | $stag -> {nodename} = $name if ($name) ; | ||
| 110 | |||
| 111 | my $etag = $ttfollow -> {$end} = { | ||
| 112 | 'text' => $end, | ||
| 113 | 'nodetype' => ntypEndTag, | ||
| 114 | 'cdatatype' => 0, | ||
| 115 | 'starttag' => $start, | ||
| 116 | 'removespaces' => 72, | ||
| 117 | } ; | ||
| 118 | return $stag ; | ||
| 119 | } | ||
| 120 | |||
| 121 | |||
| 122 | |||
| 123 | |||
| 124 | ################################################################################### | ||
| 125 | # | ||
| 126 | # Definitions for POD | ||
| 127 | # | ||
| 128 | ################################################################################### | ||
| 129 | |||
| 130 | sub Init | ||
| 131 | |||
| 132 | { | ||
| 133 | my ($self) = @_ ; | ||
| 134 | |||
| 135 | #$self -> AddPODCmd ('head1') ; | ||
| 136 | $self -> AddPODCmd ('head2') ; | ||
| 137 | $self -> AddPODCmd ('head3') ; | ||
| 138 | $self -> AddPODStartEnd ('over', 'back', 'list') ; | ||
| 139 | $self -> AddPODStartEnd ('pod', 'cut') ; | ||
| 140 | $self -> AddPODCmd ('item') ; | ||
| 141 | $self -> AddPODCmd ('item *', 'bulletitem') ; | ||
| 142 | } | ||
| 143 | |||
| 144 | |||
| 145 | %Escape = ( | ||
| 146 | '-lsearch' => 1, | ||
| 147 | 'POD Escape' => { | ||
| 148 | 'text' => '<', | ||
| 149 | 'end' => '>', | ||
| 150 | 'nodename' => ':::>:<', | ||
| 151 | 'nodetype' => ntypStartEndTag, | ||
| 152 | }, | ||
| 153 | 'POD Escape &' => { | ||
| 154 | 'text' => '&', | ||
| 155 | 'nodename' => ':::&', | ||
| 156 | 'nodetype' => ntypTag, | ||
| 157 | }, | ||
| 158 | ) ; | ||
| 159 | |||
| 160 | my %Escape2 = ( | ||
| 161 | |||
| 162 | 'POD Escape <' => { | ||
| 163 | 'text' => '<', | ||
| 164 | 'nodename' => ':::<', | ||
| 165 | 'nodetype' => ntypTag, | ||
| 166 | }, | ||
| 167 | 'POD Escape >' => { | ||
| 168 | 'text' => '>', | ||
| 169 | 'nodename' => ':::>', | ||
| 170 | 'nodetype' => ntypTag, | ||
| 171 | }, | ||
| 172 | 'POD Escape &' => { | ||
| 173 | 'text' => '&', | ||
| 174 | 'nodename' => ':::&', | ||
| 175 | 'nodetype' => ntypTag, | ||
| 176 | }, | ||
| 177 | |||
| 178 | ) ; | ||
| 179 | |||
| 180 | |||
| 181 | %Format = ( | ||
| 182 | '-lsearch' => 1, | ||
| 183 | '-defnodetype' => ntypText, | ||
| 184 | 'POD Format B' => { | ||
| 185 | 'text' => 'B<', | ||
| 186 | 'end' => '>', | ||
| 187 | 'nodename' => 'strong', | ||
| 188 | 'nodetype' => ntypStartEndTag, | ||
| 189 | }, | ||
| 190 | 'POD Format C' => { | ||
| 191 | 'text' => 'C<', | ||
| 192 | 'end' => '>', | ||
| 193 | 'nodename' => 'code', | ||
| 194 | 'nodetype' => ntypStartEndTag, | ||
| 195 | }, | ||
| 196 | 'POD Format F' => { | ||
| 197 | 'text' => 'F<', | ||
| 198 | 'end' => '>', | ||
| 199 | 'nodename' => 'code', | ||
| 200 | 'nodetype' => ntypStartEndTag, | ||
| 201 | }, | ||
| 202 | 'POD Format I' => { | ||
| 203 | 'text' => 'I<', | ||
| 204 | 'end' => '>', | ||
| 205 | 'nodename' => 'emphasis', | ||
| 206 | 'nodetype' => ntypStartEndTag, | ||
| 207 | }, | ||
| 208 | 'POD Format U' => { | ||
| 209 | 'text' => 'U<', | ||
| 210 | 'end' => '>', | ||
| 211 | 'nodename' => 'underline', | ||
| 212 | 'nodetype' => ntypStartEndTag, | ||
| 213 | }, | ||
| 214 | 'POD Format L' => { | ||
| 215 | 'text' => 'L<', | ||
| 216 | 'end' => '>', | ||
| 217 | 'nodename' => 'xlink', | ||
| 218 | 'nodetype' => ntypStartEndTag, | ||
| 219 | 'inside' => | ||
| 220 | { | ||
| 221 | -lsearch => 1, | ||
| 222 | '|' => | ||
| 223 | { | ||
| 224 | 'text' => '|', | ||
| 225 | 'end' => '>', | ||
| 226 | 'donteat' => 2, | ||
| 227 | 'follow' => { | ||
| 228 | 'Quote ""' => | ||
| 229 | { | ||
| 230 | 'text' => '"', | ||
| 231 | 'end' => '"', | ||
| 232 | 'nodename' => 'uri', | ||
| 233 | 'nodetype' => ntypAttr, | ||
| 234 | 'cdatatype' => ntypAttrValue, | ||
| 235 | 'addflags' => aflgSingleQuote, | ||
| 236 | }, | ||
| 237 | 'Quote \'\'' => | ||
| 238 | { | ||
| 239 | 'text' => '\'', | ||
| 240 | 'end' => '\'', | ||
| 241 | 'nodename' => 'uri', | ||
| 242 | 'nodetype' => ntypAttr, | ||
| 243 | 'cdatatype' => ntypAttrValue, | ||
| 244 | 'addflags' => aflgSingleQuote, | ||
| 245 | }, | ||
| 246 | 'all' => | ||
| 247 | { | ||
| 248 | 'matchall' => 1, | ||
| 249 | 'nodename' => 'uri', | ||
| 250 | 'nodetype' => ntypAttr, | ||
| 251 | 'cdatatype' => ntypAttrValue, | ||
| 252 | 'donteat' => 2, | ||
| 253 | 'addflags' => aflgSingleQuote, | ||
| 254 | }, | ||
| 255 | }, | ||
| 256 | }, | ||
| 257 | 'Quote ""' => | ||
| 258 | { | ||
| 259 | 'text' => '"', | ||
| 260 | 'end' => '"', | ||
| 261 | 'nodetype' => 0, | ||
| 262 | 'cdatatype' => ntypText, | ||
| 263 | }, | ||
| 264 | 'Quote \'\'' => | ||
| 265 | { | ||
| 266 | 'text' => '\'', | ||
| 267 | 'end' => '\'', | ||
| 268 | 'nodetype' => 0, | ||
| 269 | 'cdatatype' => ntypText, | ||
| 270 | }, | ||
| 271 | '|1' => | ||
| 272 | { | ||
| 273 | 'text' => '|', | ||
| 274 | 'end' => '>', | ||
| 275 | 'nodename' => 'uri', | ||
| 276 | 'nodetype' => ntypAttr, | ||
| 277 | 'cdatatype' => ntypAttrValue, | ||
| 278 | 'donteat' => 2, | ||
| 279 | 'addflags' => aflgSingleQuote, | ||
| 280 | }, | ||
| 281 | |||
| 282 | }, | ||
| 283 | }, | ||
| 284 | 'POD Format L 2' => { | ||
| 285 | 'text' => 'L<', | ||
| 286 | 'end' => '>', | ||
| 287 | 'nodename' => 'xlink', | ||
| 288 | 'nodetype' => ntypStartEndTag, | ||
| 289 | }, | ||
| 290 | 'POD Format #' => { | ||
| 291 | 'text' => '#<', | ||
| 292 | 'end' => '>', | ||
| 293 | 'nodename' => 'id', | ||
| 294 | 'nodetype' => ntypAttr, | ||
| 295 | 'cdatatype' => ntypAttrValue, | ||
| 296 | 'removespaces' => 72, | ||
| 297 | }, | ||
| 298 | 'http link' => { | ||
| 299 | 'text' => 'http://', | ||
| 300 | 'nodename' => 'xlink', | ||
| 301 | 'nodetype' => ntypStartEndTag, | ||
| 302 | 'contains' => '/.-:~?&=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789', | ||
| 303 | 'cdatatype' => ntypText, | ||
| 304 | 'donteat' => 1, | ||
| 305 | }, | ||
| 306 | 'https link' => { | ||
| 307 | 'text' => 'https://', | ||
| 308 | 'nodename' => 'xlink', | ||
| 309 | 'nodetype' => ntypStartEndTag, | ||
| 310 | 'contains' => '/.-:~?&=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789', | ||
| 311 | 'cdatatype' => ntypText, | ||
| 312 | 'donteat' => 1, | ||
| 313 | }, | ||
| 314 | 'ftp link' => { | ||
| 315 | 'text' => 'ftp://', | ||
| 316 | 'nodename' => 'xlink', | ||
| 317 | 'nodetype' => ntypStartEndTag, | ||
| 318 | 'contains' => '/.-:~?&=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789', | ||
| 319 | 'cdatatype' => ntypText, | ||
| 320 | 'donteat' => 1, | ||
| 321 | }, | ||
| 322 | ) ; | ||
| 323 | |||
| 324 | my $paraend = "\n\n" ; | ||
| 325 | |||
| 326 | %List = | ||
| 327 | ( | ||
| 328 | '-lsearch' => 1, | ||
| 329 | '-defnodetype' => ntypText, | ||
| 330 | 'liststart' => { | ||
| 331 | 'text' => '=over', | ||
| 332 | 'end' => '=back', | ||
| 333 | 'nodetype' => ntypStartEndTag, | ||
| 334 | 'cdatatype' => 0, | ||
| 335 | 'removespaces' => 2, | ||
| 336 | 'nodename' => 'list', | ||
| 337 | 'inside' => \%List, | ||
| 338 | }, | ||
| 339 | 'listend' => { | ||
| 340 | 'text' => '=back', | ||
| 341 | 'end' => "\n", | ||
| 342 | 'nodetype' => ntypEndTag, | ||
| 343 | 'cdatatype' => 0, | ||
| 344 | 'nodename' => 'list', | ||
| 345 | 'removespaces' => 72, | ||
| 346 | 'exitinside' => 1, | ||
| 347 | }, | ||
| 348 | 'item*' => { | ||
| 349 | 'text' => '=item *', | ||
| 350 | 'end' => '=item *', | ||
| 351 | 'donteat' => 2, | ||
| 352 | 'nodetype' => ntypStartEndTag, | ||
| 353 | 'nodename' => 'item', | ||
| 354 | 'removespaces' => 2, | ||
| 355 | 'inside' => \%ParaItem, | ||
| 356 | }, | ||
| 357 | 'item' => { | ||
| 358 | 'text' => '=item', | ||
| 359 | 'end' => '=item', | ||
| 360 | 'donteat' => 2, | ||
| 361 | 'nodetype' => ntypStartEndTag, | ||
| 362 | 'nodename' => 'item', | ||
| 363 | 'removespaces' => 2, | ||
| 364 | 'inside' => \%ParaItem, | ||
| 365 | }, | ||
| 366 | ) ; | ||
| 367 | |||
| 368 | %ListStart = | ||
| 369 | ( | ||
| 370 | %List, | ||
| 371 | 'title' => | ||
| 372 | { | ||
| 373 | 'matchall' => -1, # only match first time after =over | ||
| 374 | 'text' => "\x02", # gives sort order | ||
| 375 | 'end' => "\n", # eat until end of line | ||
| 376 | 'cdatatype' => 0, | ||
| 377 | 'nodetype' => 0, | ||
| 378 | }, | ||
| 379 | ) ; | ||
| 380 | |||
| 381 | %CDATA = | ||
| 382 | ( | ||
| 383 | '-lsearch' => 1, | ||
| 384 | 'http link' => { | ||
| 385 | 'text' => 'http://', | ||
| 386 | 'nodename' => 'xlink', | ||
| 387 | 'nodetype' => ntypStartEndTag, | ||
| 388 | 'contains' => '/.-:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789', | ||
| 389 | 'cdatatype' => ntypText, | ||
| 390 | 'donteat' => 1, | ||
| 391 | }, | ||
| 392 | 'ftp link' => { | ||
| 393 | 'text' => 'ftp://', | ||
| 394 | 'nodename' => 'xlink', | ||
| 395 | 'nodetype' => ntypStartEndTag, | ||
| 396 | 'contains' => '/.-:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789', | ||
| 397 | 'cdatatype' => ntypText, | ||
| 398 | 'donteat' => 1, | ||
| 399 | }, | ||
| 400 | 'verbatim2' => | ||
| 401 | { | ||
| 402 | 'text' => " ", | ||
| 403 | 'end' => $paraend, | ||
| 404 | 'cdatatype' => ntypCDATA, | ||
| 405 | 'nodename' => ':::<![CDATA[:]]>', | ||
| 406 | 'removespaces' => 0, | ||
| 407 | #'inside' => { 'X' => { removespaces => 0, cdatatype => ntypCDATA }}, | ||
| 408 | #'inside' => \%Format, | ||
| 409 | 'nodetype' => ntypStartEndTag, | ||
| 410 | 'donteat' => 3, | ||
| 411 | }, | ||
| 412 | |||
| 413 | |||
| 414 | ) ; | ||
| 415 | |||
| 416 | %Skip = | ||
| 417 | ( | ||
| 418 | 'skip1' => | ||
| 419 | { | ||
| 420 | # 'text' => "\n", | ||
| 421 | 'contains' => "\r\n", | ||
| 422 | 'nodetype' => ntypTag, | ||
| 423 | 'cdatatype' => 0, | ||
| 424 | 'removespaces' => 0, | ||
| 425 | 'nodename' => "!:\n", | ||
| 426 | }, | ||
| 427 | # 'skip2' => | ||
| 428 | # { | ||
| 429 | # 'text' => "\r", | ||
| 430 | # 'contains' => "\r\n", | ||
| 431 | # 'nodetype' => ntypTag, | ||
| 432 | # 'cdatatype' => 0, | ||
| 433 | # 'removespaces' => 0, | ||
| 434 | # 'nodename' => "!:\n", | ||
| 435 | # }, | ||
| 436 | ) ; | ||
| 437 | |||
| 438 | |||
| 439 | %Para = | ||
| 440 | ( | ||
| 441 | %List, | ||
| 442 | 'skip' => | ||
| 443 | { | ||
| 444 | 'text' => "\n", | ||
| 445 | 'nodetype' => 0, | ||
| 446 | 'cdatatype' => 0, | ||
| 447 | 'removespaces' => 0, | ||
| 448 | 'nodename' => "\n", | ||
| 449 | }, | ||
| 450 | 'skip2' => | ||
| 451 | { | ||
| 452 | 'text' => "\r", | ||
| 453 | 'nodetype' => 0, | ||
| 454 | 'cdatatype' => 0, | ||
| 455 | 'removespaces' => 0, | ||
| 456 | 'nodename' => '', | ||
| 457 | }, | ||
| 458 | 'para' => | ||
| 459 | { | ||
| 460 | 'matchall' => 1, | ||
| 461 | 'text' => "\0x01", # gives sort order | ||
| 462 | 'end' => $paraend, | ||
| 463 | 'cdatatype' => ntypText, | ||
| 464 | 'nodename' => 'para', | ||
| 465 | 'removespaces' => 72, | ||
| 466 | 'inside' => \%Format, | ||
| 467 | 'nodetype' => ntypStartEndTag, | ||
| 468 | }, | ||
| 469 | 'verbatim' => | ||
| 470 | { | ||
| 471 | 'text' => " ", | ||
| 472 | 'end' => $paraend, | ||
| 473 | 'cdatatype' => 0, | ||
| 474 | 'nodename' => 'verbatim', | ||
| 475 | 'removespaces' => 0, | ||
| 476 | 'inside' => \%CDATA, | ||
| 477 | 'nodetype' => ntypStartEndTag, | ||
| 478 | 'donteat' => 1, | ||
| 479 | }, | ||
| 480 | 'pic' => { | ||
| 481 | 'text' => '=pic', | ||
| 482 | 'end' => $paraend, | ||
| 483 | 'nodename' => 'pic', | ||
| 484 | 'nodetype' => ntypStartEndTag, | ||
| 485 | 'cdatatype' => ntypText, | ||
| 486 | }, | ||
| 487 | #%Skip, | ||
| 488 | ) ; | ||
| 489 | |||
| 490 | %ParaTitle = | ||
| 491 | ( | ||
| 492 | 'title' => | ||
| 493 | { | ||
| 494 | 'matchall' => -1, # only match first time after =head | ||
| 495 | 'text' => "\x02", # gives sort order | ||
| 496 | 'end' => $paraend, | ||
| 497 | 'cdatatype' => ntypText, | ||
| 498 | 'nodename' => 'title', | ||
| 499 | 'removespaces' => 40, #72, | ||
| 500 | 'inside' => \%Format, | ||
| 501 | 'nodetype' => ntypStartEndTag, | ||
| 502 | }, | ||
| 503 | %Para, | ||
| 504 | ) ; | ||
| 505 | |||
| 506 | %ParaItem = | ||
| 507 | ( | ||
| 508 | %Para, | ||
| 509 | 'itemtext' => | ||
| 510 | { | ||
| 511 | 'matchall' => -1, # only match first time after =head | ||
| 512 | 'text' => "\x02", # gives sort order | ||
| 513 | 'end' => $paraend, | ||
| 514 | 'cdatatype' => ntypText, | ||
| 515 | 'nodename' => 'itemtext', | ||
| 516 | 'removespaces' => 72, | ||
| 517 | 'inside' => \%Format, | ||
| 518 | 'nodetype' => ntypStartEndTag, | ||
| 519 | }, | ||
| 520 | 'item*' => { | ||
| 521 | 'text' => '=item *', | ||
| 522 | 'nodename' => 'item', | ||
| 523 | 'nodetype' => ntypEndTag, | ||
| 524 | 'donteat' => 1, | ||
| 525 | 'exitinside' => 1, | ||
| 526 | }, | ||
| 527 | 'item' => { | ||
| 528 | 'text' => '=item', | ||
| 529 | 'nodename' => 'item', | ||
| 530 | 'nodetype' => ntypEndTag, | ||
| 531 | 'donteat' => 1, | ||
| 532 | 'exitinside' => 1, | ||
| 533 | }, | ||
| 534 | 'listend' => { | ||
| 535 | 'text' => '=back', | ||
| 536 | 'nodename' => 'item', | ||
| 537 | 'nodetype' => ntypEndTag, | ||
| 538 | 'donteat' => 1, | ||
| 539 | 'exitinside' => 1, | ||
| 540 | }, | ||
| 541 | 'cut' => { | ||
| 542 | 'text' => '=cut', | ||
| 543 | 'nodetype' => 0, | ||
| 544 | 'cdatatype' => 0, | ||
| 545 | 'nodename' => '', | ||
| 546 | 'inside' => \%SearchInside, | ||
| 547 | }, | ||
| 548 | |||
| 549 | |||
| 550 | ) ; | ||
| 551 | |||
| 552 | %SearchInside = | ||
| 553 | ( | ||
| 554 | '-lsearch' => 1, | ||
| 555 | '-defnodetype' => 0, | ||
| 556 | 'start' => { | ||
| 557 | 'text' => "\n=", | ||
| 558 | 'donteat' => 1, | ||
| 559 | 'nodetype' => 0, | ||
| 560 | 'cdatatype' => 0, | ||
| 561 | 'removespaces' => 2, | ||
| 562 | 'exitinside' => 1, | ||
| 563 | }, | ||
| 564 | ) ; | ||
| 565 | |||
| 566 | |||
| 567 | %Tags = | ||
| 568 | ( | ||
| 569 | '-lsearch' => 1, | ||
| 570 | '-defnodetype' => ntypText, | ||
| 571 | 'head1name' => { | ||
| 572 | 'text' => '=head1 NAME', | ||
| 573 | 'end' => '=head1', | ||
| 574 | 'donteat' => 2, | ||
| 575 | 'nodetype' => ntypStartEndTag, | ||
| 576 | 'nodename' => 'head', | ||
| 577 | 'removespaces' => 2, | ||
| 578 | 'inside' => { | ||
| 579 | '-lsearch' => 1, | ||
| 580 | 'title' => | ||
| 581 | { | ||
| 582 | 'matchall' => -1, # only match first time after =head | ||
| 583 | 'text' => "\x02", # gives sort order | ||
| 584 | 'end' => $paraend, | ||
| 585 | 'cdatatype' => ntypText, | ||
| 586 | 'nodename' => 'title', | ||
| 587 | 'removespaces' => 72, | ||
| 588 | 'inside' => \%Format, | ||
| 589 | 'nodetype' => ntypStartEndTag, | ||
| 590 | }, | ||
| 591 | }, | ||
| 592 | }, | ||
| 593 | 'head1' => { | ||
| 594 | 'text' => '=head1', | ||
| 595 | 'end' => '=head1', | ||
| 596 | 'donteat' => 2, | ||
| 597 | 'nodetype' => ntypStartEndTag, | ||
| 598 | 'nodename' => 'sect1', | ||
| 599 | 'removespaces' => 2, | ||
| 600 | 'inside' => { | ||
| 601 | '-lsearch' => 1, | ||
| 602 | %ParaTitle, | ||
| 603 | 'head1' => { | ||
| 604 | 'text' => '=head1', | ||
| 605 | 'nodename' => 'sect1', | ||
| 606 | 'nodetype' => ntypEndTag, | ||
| 607 | 'donteat' => 1, | ||
| 608 | 'exitinside' => 1, | ||
| 609 | }, | ||
| 610 | 'cut' => { | ||
| 611 | 'text' => '=cut', | ||
| 612 | 'nodename' => 'sect1', | ||
| 613 | 'nodetype' => ntypEndTag, | ||
| 614 | 'donteat' => 1, | ||
| 615 | 'exitinside' => 1, | ||
| 616 | }, | ||
| 617 | 'head2' => { | ||
| 618 | 'text' => '=head2', | ||
| 619 | 'end' => '=head2', | ||
| 620 | 'donteat' => 2, | ||
| 621 | 'nodetype' => ntypStartEndTag, | ||
| 622 | 'nodename' => 'sect2', | ||
| 623 | 'removespaces' => 2, | ||
| 624 | 'inside' => { | ||
| 625 | '-lsearch' => 1, | ||
| 626 | %ParaTitle, | ||
| 627 | 'head1' => { | ||
| 628 | 'text' => '=head1', | ||
| 629 | 'nodename' => 'sect2', | ||
| 630 | 'nodetype' => ntypEndTag, | ||
| 631 | 'cdatatype' => 0, | ||
| 632 | 'donteat' => 1, | ||
| 633 | 'exitinside' => 1, | ||
| 634 | }, | ||
| 635 | 'head2' => { | ||
| 636 | 'text' => '=head2', | ||
| 637 | 'nodetype' => ntypEndTag, | ||
| 638 | 'nodename' => 'sect2', | ||
| 639 | 'donteat' => 1, | ||
| 640 | 'exitinside' => 1, | ||
| 641 | }, | ||
| 642 | 'cut' => { | ||
| 643 | 'text' => '=cut', | ||
| 644 | 'nodetype' => 0, | ||
| 645 | 'cdatatype' => 0, | ||
| 646 | 'nodename' => '', | ||
| 647 | 'inside' => \%SearchInside, | ||
| 648 | }, | ||
| 649 | 'head3' => { | ||
| 650 | 'text' => '=head3', | ||
| 651 | 'end' => '=head3', | ||
| 652 | 'donteat' => 2, | ||
| 653 | 'nodetype' => ntypStartEndTag, | ||
| 654 | 'nodename' => 'sect3', | ||
| 655 | 'removespaces' => 2, | ||
| 656 | 'inside' => { | ||
| 657 | '-lsearch' => 1, | ||
| 658 | %ParaTitle, | ||
| 659 | 'head1' => { | ||
| 660 | 'text' => '=head1', | ||
| 661 | 'nodename' => 'sect3', | ||
| 662 | 'nodetype' => ntypEndTag, | ||
| 663 | 'cdatatype' => 0, | ||
| 664 | 'donteat' => 1, | ||
| 665 | 'exitinside' => 1, | ||
| 666 | }, | ||
| 667 | 'head2' => { | ||
| 668 | 'text' => '=head2', | ||
| 669 | 'nodetype' => ntypEndTag, | ||
| 670 | 'cdatatype' => 0, | ||
| 671 | 'nodename' => 'sect3', | ||
| 672 | 'donteat' => 1, | ||
| 673 | 'exitinside' => 1, | ||
| 674 | }, | ||
| 675 | 'head3' => { | ||
| 676 | 'text' => '=head3', | ||
| 677 | 'nodetype' => ntypEndTag, | ||
| 678 | 'nodename' => 'sect3', | ||
| 679 | 'donteat' => 1, | ||
| 680 | 'exitinside' => 1, | ||
| 681 | }, | ||
| 682 | 'cut' => { | ||
| 683 | 'text' => '=cut', | ||
| 684 | 'nodetype' => 0, | ||
| 685 | 'cdatatype' => 0, | ||
| 686 | 'nodename' => '', | ||
| 687 | 'inside' => \%SearchInside, | ||
| 688 | }, | ||
| 689 | }, | ||
| 690 | }, | ||
| 691 | }, | ||
| 692 | }, | ||
| 693 | }, | ||
| 694 | }, | ||
| 695 | 'cut' => { | ||
| 696 | 'text' => '=cut', | ||
| 697 | 'nodetype' => 0, | ||
| 698 | 'cdatatype' => 0, | ||
| 699 | 'exitinside' => 1, | ||
| 700 | }, | ||
| 701 | # %Para, | ||
| 702 | ) ; | ||
| 703 | |||
| 704 | %Search = | ||
| 705 | ( | ||
| 706 | '-lsearch' => 1, | ||
| 707 | '-defnodetype' => 0, | ||
| 708 | '-rootnode' => 'pod', | ||
| 709 | 'start' => { | ||
| 710 | 'text' => "\n=", | ||
| 711 | 'donteat' => 1, | ||
| 712 | 'nodetype' => 0, | ||
| 713 | 'cdatatype' => 0, | ||
| 714 | 'removespaces' => 2, | ||
| 715 | 'inside' => \%Tags | ||
| 716 | }, | ||
| 717 | 'startpod' => { | ||
| 718 | 'text' => '=pod', | ||
| 719 | 'end' => "\n", | ||
| 720 | 'nodetype' => 0, | ||
| 721 | 'cdatatype' => 0, | ||
| 722 | 'removespaces' => 2, | ||
| 723 | 'inside' => \%Tags | ||
| 724 | }, | ||
| 725 | 'startpod2' => { | ||
| 726 | 'text' => "\n=pod", | ||
| 727 | 'end' => "\n", | ||
| 728 | 'nodetype' => 0, | ||
| 729 | 'cdatatype' => 0, | ||
| 730 | 'removespaces' => 2, | ||
| 731 | 'inside' => \%Tags | ||
| 732 | }, | ||
| 733 | ) ; | ||
| 734 | |||
| 735 | 1; | ||
| 736 | |||
| 737 | |||
| 738 | __END__ |