~ubuntu-branches/ubuntu/trusty/libpod-simple-perl/trusty

« back to all changes in this revision

Viewing changes to lib/Pod/Simple/BlackBox.pm

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Yu
  • Date: 2010-05-01 23:28:32 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20100501232832-uhsd4zwmusp12z65
Tags: 3.14-1
* New upstream release
* Use new 3.0 (quilt) source format
* Standards-Version 3.8.4 (no changes)
* Add a patch to fix POD spelling errors
* Update copyright information to DEP5 format

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
use strict;
24
24
use Carp ();
25
25
use vars qw($VERSION );
26
 
$VERSION = '3.13';
 
26
$VERSION = '3.14';
27
27
#use constant DEBUG => 7;
28
28
BEGIN {
29
29
  require Pod::Simple;
1701
1701
    if(defined $1) {
1702
1702
      if(defined $2) {
1703
1703
        DEBUG > 3 and print "Found complex start-text code \"$1\"\n";
1704
 
        # signal that we're looking for simple unless we're in complex.
1705
 
        if ($stack[-1]) {
1706
 
            # We're in complex already. It's just stuff.
1707
 
            DEBUG > 4 and print " It's just stuff.\n";
1708
 
            push @{ $lineage[-1] }, $1;
1709
 
        } else {
1710
 
            # length of the necessary complex end-code string
1711
 
            push @stack, length($2) + 1;
1712
 
            push @lineage, [ substr($1,0,1), {}, ];  # new node object
1713
 
            push @{ $lineage[-2] }, $lineage[-1];
1714
 
        }
 
1704
        push @stack, length($2) + 1; 
 
1705
          # length of the necessary complex end-code string
1715
1706
      } else {
1716
1707
        DEBUG > 3 and print "Found simple start-text code \"$1\"\n";
1717
 
        if ($stack[-1]) {
1718
 
            # We're in complex already. It's just stuff.
1719
 
            DEBUG > 4 and print " It's just stuff.\n";
1720
 
            push @{ $lineage[-1] }, $1;
1721
 
        } else {
1722
 
            # signal that we're looking for simple.
1723
 
            push @stack, 0;
1724
 
            push @lineage, [ substr($1,0,1), {}, ];  # new node object
1725
 
            push @{ $lineage[-2] }, $lineage[-1];
1726
 
        }
 
1708
        push @stack, 0;  # signal that we're looking for simple
1727
1709
      }
 
1710
      push @lineage, [ substr($1,0,1), {}, ];  # new node object
 
1711
      push @{ $lineage[-2] }, $lineage[-1];
 
1712
      
1728
1713
    } elsif(defined $4) {
1729
1714
      DEBUG > 3 and print "Found apparent complex end-text code \"$3$4\"\n";
1730
1715
      # This is where it gets messy...
1828
1813
 
1829
1814
sub _stringify_lol {  # the real recursor
1830
1815
  my($lol, $to) = @_;
1831
 
  use UNIVERSAL ();
1832
1816
  for(my $i = 2; $i < @$lol; ++$i) {
1833
1817
    if( ref($lol->[$i] || '') and UNIVERSAL::isa($lol->[$i], 'ARRAY') ) {
1834
1818
      _stringify_lol( $lol->[$i], $to);  # recurse!