Skip to content

Commit

Permalink
import Pod::Simple 2.05 from CPAN
Browse files Browse the repository at this point in the history
git-cpan-module: Pod::Simple
git-cpan-version: 2.05
git-cpan-authorid: SBURKE
  • Loading branch information
Sean M. Burke authored and schwern committed Dec 4, 2009
1 parent d6a6354 commit d8e219f
Show file tree
Hide file tree
Showing 31 changed files with 267 additions and 57 deletions.
14 changes: 13 additions & 1 deletion ChangeLog
@@ -1,6 +1,18 @@
# ChangeLog for Pod::Simple dist # Time-stamp: "2003-10-10 15:46:36 ADT"
# ChangeLog for Pod::Simple dist # Time-stamp: "2003-11-04 23:16:23 AST"
#---------------------------------------------------------------------------

2003-11-04 Sean M. Burke <sburke@cpan.org>
* Release 2.05 -- bugfix version

In an attempt to stop Perl 5.6 versions from going completely
crazy, I've tried to basically turn off all Unicode/utf8 support
under 5.6. Under 5.8 and above, Unicode should work fine, and
under 5.6, all Unicode characters should be replaced with a little
"can't render" symbol, either a "�" or a "?".
Many many thanks to Jarkko Hietaniemi for helping out.

(Works under 5.005 now too?)

2003-10-10 Sean M. Burke <sburke@cpan.org>
* Release 2.04 -- minor bugfix version

Expand Down
3 changes: 3 additions & 0 deletions MANIFEST
Expand Up @@ -30,6 +30,8 @@ Makefile.PL
MANIFEST
MANIFEST.SKIP
README
t/00about.t
t/20_skip_before_58.t
t/ac_c_extend.t
t/ac_c_simple.t
t/ac_d.t
Expand Down Expand Up @@ -96,6 +98,7 @@ t/corpus_not_yet_impl/polish_utf8_bom2.xml
t/corpustest.t
t/encoding_nonesuch.t
t/encoding_not_error.t
t/encoding_not_error0.t
t/fcodes.t
t/fcodes_ee.t
t/fcodes_ell.t
Expand Down
5 changes: 2 additions & 3 deletions META.yml
@@ -1,13 +1,12 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Pod-Simple
version: 2.04
version: 2.05
version_from: lib/Pod/Simple.pm
installdirs: site
requires:
Pod::Escapes: 1.03
Text::Wrap: 98.112902
utf8: 0

distribution_type: module
generated_by: ExtUtils::MakeMaker version 6.17
generated_by: ExtUtils::MakeMaker version 6.19
5 changes: 2 additions & 3 deletions Makefile.PL
@@ -1,12 +1,12 @@
# This -*- perl -*- script writes the Makefile for Pod::Simple
#
# Time-stamp: "2003-09-07 01:26:12 ADT"
# Time-stamp: "2003-11-01 21:15:13 AST"
#
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
#

require 5.006; # because of all our utf8 stuff.
require 5;

use strict;
use ExtUtils::MakeMaker;
Expand All @@ -19,7 +19,6 @@ WriteMakefile
PREREQ_PM => {
'Text::Wrap' => '98.112902',
'Pod::Escapes' => '1.03',
'utf8' => '0',
},
# INSTALLDIRS => 'perl',
);
Expand Down
27 changes: 20 additions & 7 deletions lib/Pod/Simple.pm
Expand Up @@ -8,7 +8,7 @@ use integer;
use Pod::Escapes 1.03 ();
use Pod::Simple::LinkSection ();
use Pod::Simple::BlackBox ();
use utf8;
#use utf8;

use vars qw(
$VERSION @ISA
Expand All @@ -18,7 +18,7 @@ use vars qw(
);

@ISA = ('Pod::Simple::BlackBox');
$VERSION = '2.04';
$VERSION = '2.05';

@Known_formatting_codes = qw(I B C L E F S X Z);
%Known_formatting_codes = map(($_=>1), @Known_formatting_codes);
Expand All @@ -39,9 +39,13 @@ BEGIN {
unless(MANY_LINES() >= 1) {
die "MANY_LINES is too small (", MANY_LINES(), ")!\nAborting";
}
if(defined &UNICODE) { }
elsif($] >= 5.008) { *UNICODE = sub() {1} }
else { *UNICODE = sub() {''} }
}
if(DEBUG > 2) {
print "# We are ", ASCII ? '' : 'not ', "in ASCII-land\n";
print "# We are under a Unicode-safe Perl.\n";
}

# Design note:
Expand Down Expand Up @@ -1236,7 +1240,7 @@ sub _treat_Ls { # Process our dear dear friends, the L<...> sequences
sub _treat_Es {
my($self,@stack) = @_;

my($i, $treelet, $content, $replacer);
my($i, $treelet, $content, $replacer, $charnum);
my $start_line = $stack[0][1]{'start_line'};

# A recursive algorithm implemented iteratively! Whee!
Expand Down Expand Up @@ -1295,12 +1299,21 @@ sub _treat_Es {

DEBUG > 1 and print "Ogling E<$content>\n";

if(defined( $replacer = Pod::Escapes::e2char($content) )) {
DEBUG > 1 and print "Replacing E<$content> with $replacer\n";
} else {
DEBUG > 1 and print "I don't know how to deal with E<$content>\n";
$charnum = Pod::Escapes::e2charnum($content);
DEBUG > 1 and print " Considering E<$content> with char ",
defined($charnum) ? $charnum : "undef", ".\n";

if(!defined( $charnum )) {
DEBUG > 1 and print "I don't know how to deal with E<$content>.\n";
$self->whine( $start_line, "Unknown E content in E<$content>" );
$replacer = "E<$content>"; # better than nothing
} elsif($charnum >= 255 and !UNICODE) {
$replacer = ASCII ? "\xA4" : "?";
DEBUG > 1 and print "This Perl version can't handle ",
"E<$content> (chr $charnum), so replacing with $replacer\n";
} else {
$replacer = Pod::Escapes::e2char($content);
DEBUG > 1 and print " Replacing E<$content> with $replacer\n";
}

splice(@$treelet, $i, 1, $replacer); # no need to back up $i, tho
Expand Down
1 change: 0 additions & 1 deletion lib/Pod/Simple/BlackBox.pm
Expand Up @@ -20,7 +20,6 @@ package Pod::Simple::BlackBox;
# Every node in a treelet is a ['name', {attrhash}, ...children...]

use integer; # vroom!
use utf8;
use strict;
use Carp ();
BEGIN {
Expand Down
5 changes: 2 additions & 3 deletions lib/Pod/Simple/Checker.pm
Expand Up @@ -5,19 +5,18 @@
require 5;
package Pod::Simple::Checker;
use strict;
use utf8;
use Carp ();
use Pod::Simple::Methody ();
use Pod::Simple ();
use vars qw( @ISA $VERSION );
$VERSION = '2.01';
$VERSION = '2.02';
@ISA = ('Pod::Simple::Methody');
BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG)
? \&Pod::Simple::DEBUG
: sub() {0}
}

use Text::Wrap 2001.0131 ();
use Text::Wrap 98.112902 (); # was 2001.0131, but I don't think we need that
$Text::Wrap::wrap = 'overflow';
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
1 change: 0 additions & 1 deletion lib/Pod/Simple/Debug.pm
Expand Up @@ -2,7 +2,6 @@
require 5;
package Pod::Simple::Debug;
use strict;
use utf8;

sub import {
my($value,$variable);
Expand Down
3 changes: 1 addition & 2 deletions lib/Pod/Simple/DumpAsText.pm
@@ -1,8 +1,7 @@

require 5;
package Pod::Simple::DumpAsText;
$VERSION = '2.01';
use utf8;
$VERSION = '2.02';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}

Expand Down
3 changes: 1 addition & 2 deletions lib/Pod/Simple/DumpAsXML.pm
@@ -1,8 +1,7 @@

require 5;
package Pod::Simple::DumpAsXML;
$VERSION = '2.01';
use utf8;
$VERSION = '2.02';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}

Expand Down
4 changes: 1 addition & 3 deletions lib/Pod/Simple/HTML.pm
Expand Up @@ -5,13 +5,11 @@ use strict;
use Pod::Simple::PullParser ();
use vars qw(@ISA %Tagmap $Computerese $Lame $Linearization_Limit $VERSION);
@ISA = ('Pod::Simple::PullParser');
$VERSION = '2.01';
$VERSION = '2.02';

use UNIVERSAL ();
sub DEBUG () {0}

use utf8;

$Computerese = " lang='und' xml:lang='und'" unless defined $Computerese;
$Lame = ' class="pad"' unless defined $Lame;

Expand Down
1 change: 0 additions & 1 deletion lib/Pod/Simple/LinkSection.pm
Expand Up @@ -4,7 +4,6 @@ package Pod::Simple::LinkSection;
# Based somewhat dimly on Array::Autojoin

use strict;
use utf8;
use Pod::Simple::BlackBox;

use overload( # So it'll stringify nice
Expand Down
3 changes: 1 addition & 2 deletions lib/Pod/Simple/Methody.pm
Expand Up @@ -2,10 +2,9 @@
require 5;
package Pod::Simple::Methody;
use strict;
use utf8;
use Pod::Simple ();
use vars qw(@ISA $VERSION);
$VERSION = '2.01';
$VERSION = '2.02';
@ISA = ('Pod::Simple');

# Yes, we could use named variables, but I want this to be impose
Expand Down
3 changes: 1 addition & 2 deletions lib/Pod/Simple/PullParser.pm
@@ -1,12 +1,11 @@

require 5;
package Pod::Simple::PullParser;
$VERSION = '2.01';
$VERSION = '2.02';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}

use strict;
use utf8;
use Carp ();

use Pod::Simple::PullParserStartToken;
Expand Down
1 change: 0 additions & 1 deletion lib/Pod/Simple/PullParserEndToken.pm
Expand Up @@ -4,7 +4,6 @@ package Pod::Simple::PullParserEndToken;
use Pod::Simple::PullParserToken ();
@ISA = ('Pod::Simple::PullParserToken');
use strict;
use utf8;

sub new { # Class->new(tagname);
my $class = shift;
Expand Down
1 change: 0 additions & 1 deletion lib/Pod/Simple/PullParserStartToken.pm
Expand Up @@ -4,7 +4,6 @@ package Pod::Simple::PullParserStartToken;
use Pod::Simple::PullParserToken ();
@ISA = ('Pod::Simple::PullParserToken');
use strict;
use utf8;

sub new { # Class->new(tagname, optional_attrhash);
my $class = shift;
Expand Down
1 change: 0 additions & 1 deletion lib/Pod/Simple/PullParserTextToken.pm
Expand Up @@ -4,7 +4,6 @@ package Pod::Simple::PullParserTextToken;
use Pod::Simple::PullParserToken ();
@ISA = ('Pod::Simple::PullParserToken');
use strict;
use utf8;

sub new { # Class->new(text);
my $class = shift;
Expand Down
3 changes: 1 addition & 2 deletions lib/Pod/Simple/PullParserToken.pm
Expand Up @@ -3,9 +3,8 @@ require 5;
package Pod::Simple::PullParserToken;
# Base class for tokens gotten from Pod::Simple::PullParser's $parser->get_token
@ISA = ();
$VERSION = '2.01';
$VERSION = '2.02';
use strict;
use utf8;

sub new { # Class->new('type', stuff...); ## Overridden in derived classes anyway
my $class = shift;
Expand Down
3 changes: 1 addition & 2 deletions lib/Pod/Simple/RTF.pm
@@ -1,15 +1,14 @@

require 5;
package Pod::Simple::RTF;
use utf8;

#sub DEBUG () {4};
#sub Pod::Simple::DEBUG () {4};
#sub Pod::Simple::PullParser::DEBUG () {4};

use strict;
use vars qw($VERSION @ISA %Escape $WRAP %Tagmap);
$VERSION = '2.01';
$VERSION = '2.02';
use Pod::Simple::PullParser ();
BEGIN {@ISA = ('Pod::Simple::PullParser')}

Expand Down
3 changes: 1 addition & 2 deletions lib/Pod/Simple/SimpleTree.pm
Expand Up @@ -3,11 +3,10 @@
require 5;
package Pod::Simple::SimpleTree;
use strict;
use utf8;
use Carp ();
use Pod::Simple ();
use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS);
$VERSION = '2.01';
$VERSION = '2.02';
BEGIN {
@ISA = ('Pod::Simple');
*DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG;
Expand Down
3 changes: 1 addition & 2 deletions lib/Pod/Simple/Text.pm
Expand Up @@ -2,12 +2,11 @@
require 5;
package Pod::Simple::Text;
use strict;
use utf8;
use Carp ();
use Pod::Simple::Methody ();
use Pod::Simple ();
use vars qw( @ISA $VERSION $FREAKYMODE);
$VERSION = '2.01';
$VERSION = '2.02';
@ISA = ('Pod::Simple::Methody');
BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG)
? \&Pod::Simple::DEBUG
Expand Down
3 changes: 1 addition & 2 deletions lib/Pod/Simple/TextContent.pm
Expand Up @@ -3,11 +3,10 @@
require 5;
package Pod::Simple::TextContent;
use strict;
use utf8;
use Carp ();
use Pod::Simple ();
use vars qw( @ISA $VERSION );
$VERSION = '2.01';
$VERSION = '2.02';
@ISA = ('Pod::Simple');

sub new {
Expand Down
1 change: 0 additions & 1 deletion lib/Pod/Simple/TiedOutFH.pm
Expand Up @@ -3,7 +3,6 @@ use strict;
package Pod::Simple::TiedOutFH;
use Symbol ('gensym');
use Carp ();
use utf8;

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
19 changes: 17 additions & 2 deletions lib/Pod/Simple/TranscodeDumb.pm
Expand Up @@ -5,7 +5,7 @@ require 5;
package Pod::Simple::TranscodeDumb;
use strict;
use vars qw($VERSION %Supported);
$VERSION = '2.01';
$VERSION = '2.02';
# This module basically pretends it knows how to transcode, except
# only for null-transcodings! We use this when Encode isn't
# available.
Expand Down Expand Up @@ -39,7 +39,22 @@ sub make_transcoder {
my($e) = $_[1];
die "WHAT ENCODING!?!?" unless $e;
my $x;
return sub {;}; # no-opn
return sub {;
#foreach $x (@_) {
# if(Pod::Simple::ASCII and !Pod::Simple::UNICODE and $] > 5.005) {
# # We're in horrible gimp territory, so we need to knock out
# # all the highbit things
# $x =
# pack 'C*',
# map {; ($_ < 128) ? $_ : 0x7e }
# unpack "C*",
# $x
# ;
# }
#}
#
#return;
};
}


Expand Down

0 comments on commit d8e219f

Please sign in to comment.