/[suikacvs]/markup/2004/tex/pretex.pl
Suika

Diff of /markup/2004/tex/pretex.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by wakaba, Sun Jun 13 03:53:35 2004 UTC revision 1.3 by wakaba, Sat Dec 11 08:33:57 2004 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl  #!/usr/bin/perl
2  use strict;  use strict;
3  use Encode;  use Encode;
4    my $opt = {};
5  sub c{  sub c{
6    $_ = shift;    $_ = shift;
7      s/\\preprocess{([^{}=\s]+)(?:\s*=\s*([^{}=\s]*))?}/$opt->{$1}=defined$2?$2:1;''/ge;
8    s/\x{3001}/, /g;    s/\x{3001}/, /g;
9    s/\x{3002}/. /g;    s/\x{3002}/. /g;
10      s/\$/\\\$/g if $opt->{'Perl-mode'};
11    s{\\sourcecode\s*(?:\[([^\[\]]*)\]\s*)?{([^{}]+)}}{    s{\\sourcecode\s*(?:\[([^\[\]]*)\]\s*)?{([^{}]+)}}{
12      my %opt = map {$_->[1] = 1 unless defined $_->[1]; @$_}      my %opt = map {$_->[1] = 1 unless defined $_->[1]; @$_}
13                map {[split /\s*=\s*/, $_, 2]} split /\s*,\s*/, $1;                map {[split /\s*=\s*/, $_, 2]} split /\s*,\s*/, $1;
# Line 13  sub c{ Line 16  sub c{
16      my $source = '';      my $source = '';
17      my $line = 1;      my $line = 1;
18      for (<$file>) {      for (<$file>) {
19          s/\x0C//g;
20        s/\t/        /g and warn "$0: $filename\[$line]: TAB found";        s/\t/        /g and warn "$0: $filename\[$line]: TAB found";
21        $source .= sprintf '%3d %s', $line++, $_;        $source .= sprintf '%3d %s', $line++, $_;
22      }      }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24