diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2020-08-31 10:53:49 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2020-08-31 10:53:49 +0000 |
commit | 0d0ea8ee8f2d2c5e3a700bf22417441d2424a9f9 (patch) | |
tree | 282ac717ef4f21a0ac8ef6f863cc9610401a7c70 /w3m-doc/sample/w3mdoc.pl | |
parent | Update ChangeLog (diff) | |
download | w3m-0d0ea8ee8f2d2c5e3a700bf22417441d2424a9f9.tar.gz w3m-0d0ea8ee8f2d2c5e3a700bf22417441d2424a9f9.zip |
Drop obsolete w3m-doc
Diffstat (limited to '')
-rwxr-xr-x | w3m-doc/sample/w3mdoc.pl | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/w3m-doc/sample/w3mdoc.pl b/w3m-doc/sample/w3mdoc.pl deleted file mode 100755 index 6097926..0000000 --- a/w3m-doc/sample/w3mdoc.pl +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/local/bin/perl - -package w3mdoc; - -sub CHECK { - my($a, @b) = @_; - for(@b) { - defined($a->{$_}) || die("\"$a->{id}.$_\" is not defined.\n"); - } -} - -sub DEF { - my($a, $b, $c) = @_; - - if (! defined($data->{$a})) { - $data->{$a} = bless { id => $a }; - } - $data->{$a}{$b} = $c; -} - -sub SUB { - local($_) = @_; - my($a, $b); - - if (/^\@(\w+)\.(\w+)\@$/) { - ($a, $b) = ($1, $2); - defined($data->{$a}) || die("\"$a.$b\" is not defined.\n"); - $data->{$a}->CHECK($b); - return $data->{$a}{$b}; - } - if (/^\@(\w+)\((\w+)\)\@$/) { - ($a, $b) = ($1, $2); - defined(&{$a}) || die("\"$a()\" is not defined.\n"); - defined($data->{$b}) || die("\"$a($b)\" is not defined.\n"); - return $data->{$b}->$a(); - } - return '@'; -} - -package main; - -@ARGV || unshift(@ARGV, "-"); -while(@ARGV) { - $file = shift @ARGV; - &make_doc($file); -} - -sub make_doc { - my($file) = @_; - my($in_def, $in_code, $code, $a, $b); - local(*F); - local($_); - - open(F, $file) || die("$file: $!\n"); - $in_def = 0; - $in_code = 0; - while(<F>) { - if ($in_def) { - if (/^\@end/) { - $in_def = 0; - next; - } - s/^\s+//; - s/^(\w+)\.(\w+)// || next; - ($a, $b) = ($1, $2); - s/^\s+//; - s/\s+$//; - &w3mdoc::DEF($a, $b, $_); - next; - } - if ($in_code) { - if (/^\@end/) { - eval "package w3mdoc; $code"; - $in_code = 0; - next; - } - $code .= $_; - next; - } - if (/^\@define/) { - $in_def = 1; - next; - } - if (/^\@code/) { - $in_code = 1; - $code = ""; - next; - } - if (s/^\@include\s+//) { - s/\s+$//; - &make_doc($_); - next; - } - if (/^\@/) { - die("unknown command: $_"); - } - s/(\\@|\@(\w+(\.\w+|\(\w+\)))\@)/&w3mdoc::SUB($1)/eg; - print; - } - close(F); -} - |