home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-09-05 | 1.3 KB | 69 lines | [TEXT/MPS ] |
- Perl -Sx "{0}" {"Parameters"} | Perl -pe 's/^@ $/@/'; Exit
-
- #!perl
- # Copyright 1991 by Norman Ramsey. All rights reserved.
- # See file COPYRIGHT for more information.
-
- line: while (<>) {
- chop; # strip record separator
- if (/^@begin docs 0$/) {
- next line;
- }
- if (/^@begin docs /) {
- printf '@ ';
- }
- if (/^@begin code /) {
- }
- if (/^@end [cd]o[dc][es] /) {
- if ($dangling_text) {
- printf "\n";
- }
- $dangling_text = 0;
- printf '%s', $deflines;
- if ($defline ne '') {
- printf "%s\n", $defline;
- }
- $deflines = '';
- $defline = '';
- }
- if (/^@defn /) {
- printf '<<%s>>=', substr($_, 7, 999999);
- }
- if (/^@text $/) {
- next line;
- }
- if (/^@text /) {
- $s = '<<', s/$s/@<</g;
- $s = '>>', s/$s/@>>/g;
- printf '%s', substr($_, 7, 999999);
- $dangling_text = 1;
- }
- if (/^@quote$/) {
- printf (('[['));
- $dangling_text = 1;
- }
- if (/^@endquote$/) {
- printf ((']]'));
- $dangling_text = 1;
- }
- if (/^@nl$/) {
- printf "\n";
- $dangling_text = 0;
- }
-
- if (/^@index defn /) {
- if ($defline eq '') {
- $defline = '@ %def';
- }
- $defline = $defline . ' ' . substr($_, 13, 999999);
- }
- if (/^@index nl$/) {
- $deflines = $deflines . $defline . "\n";
- $defline = '';
- }
- if (/^@use /) {
- printf '<<%s>>', substr($_, 6, 999999);
- $dangling_text = 1;
- }
- }
-