diff options
Diffstat (limited to 'beagle/debian-rfs/usr/share/perl/5.10.1/Text/Tabs.pm')
| -rw-r--r-- | beagle/debian-rfs/usr/share/perl/5.10.1/Text/Tabs.pm | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/beagle/debian-rfs/usr/share/perl/5.10.1/Text/Tabs.pm b/beagle/debian-rfs/usr/share/perl/5.10.1/Text/Tabs.pm deleted file mode 100644 index b20d98b..0000000 --- a/beagle/debian-rfs/usr/share/perl/5.10.1/Text/Tabs.pm +++ /dev/null @@ -1,89 +0,0 @@ -package Text::Tabs; - -require Exporter; - -@ISA = (Exporter); -@EXPORT = qw(expand unexpand $tabstop); - -use vars qw($VERSION $tabstop $debug); -$VERSION = 2009.0305; - -use strict; - -BEGIN { - $tabstop = 8; - $debug = 0; -} - -sub expand { - my @l; - my $pad; - for ( @_ ) { - my $s = ''; - for (split(/^/m, $_, -1)) { - my $offs = 0; - s{\t}{ - $pad = $tabstop - (pos() + $offs) % $tabstop; - $offs += $pad - 1; - " " x $pad; - }eg; - $s .= $_; - } - push(@l, $s); - } - return @l if wantarray; - return $l[0]; -} - -sub unexpand -{ - my (@l) = @_; - my @e; - my $x; - my $line; - my @lines; - my $lastbit; - my $ts_as_space = " "x$tabstop; - for $x (@l) { - @lines = split("\n", $x, -1); - for $line (@lines) { - $line = expand($line); - @e = split(/(.{$tabstop})/,$line,-1); - $lastbit = pop(@e); - $lastbit = '' - unless defined $lastbit; - $lastbit = "\t" - if $lastbit eq $ts_as_space; - for $_ (@e) { - if ($debug) { - my $x = $_; - $x =~ s/\t/^I\t/gs; - print "sub on '$x'\n"; - } - s/ +$/\t/; - } - $line = join('',@e, $lastbit); - } - $x = join("\n", @lines); - } - return @l if wantarray; - return $l[0]; -} - -1; -__END__ - -sub expand -{ - my (@l) = @_; - for $_ (@l) { - 1 while s/(^|\n)([^\t\n]*)(\t+)/ - $1. $2 . (" " x - ($tabstop * length($3) - - (length($2) % $tabstop))) - /sex; - } - return @l if wantarray; - return $l[0]; -} - |
