mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-05 11:40:20 +02:00
GUILE_PROC1. Build guile-procedures.txt, and add that file to pkgdata_DATA. * load.c: Added `pkgdata-dir', `site-dir', `library-dir' primitives. * guile-doc-snarf.awk: Drop trailing space when no arguments: e.g., "(foo )" is now "(foo)". * *.c: moved all the documentation for primitives from guile-doc/ref/{appendices,posix,scheme}.texi into the source code. This leaves about half of the primitives undocumented. Also, all the markup is currently still texinfo. I don't have a problem with texinfo per se, but the markup is not very descriptive or accurate.
51 lines
1.8 KiB
Awk
51 lines
1.8 KiB
Awk
#!/usr/bin/awk -f
|
||
# Written by Greg J. Badros, <gjb@cs.washington.edu>
|
||
# 12-Dec-1999
|
||
|
||
BEGIN { FS="|";
|
||
filename = ARGV[1]; ARGV[1] = "";
|
||
dot_x_file = filename; dot_doc_file = filename;
|
||
sub(/\..*$/,".x",dot_x_file);
|
||
sub(/\..*$/,".doc",dot_doc_file);
|
||
# be sure to put something in the files to help make out
|
||
printf "" > dot_x_file;
|
||
printf "" > dot_doc_file;
|
||
}
|
||
|
||
/^[ \t]*%%%/ { copy = $0;
|
||
gsub(/[ \t]*%%%/, "", copy);
|
||
gsub(/\$\$\$.*$/, "", copy);
|
||
print copy > dot_x_file }
|
||
|
||
/\$\$\$/,/@@@/ { copy = $0;
|
||
if (match(copy,/\$\$\$R/)) { registering = 1; }
|
||
else {registering = 0; }
|
||
gsub(/.*\$\$\$./,"", copy);
|
||
gsub(/@@@.*/,"",copy);
|
||
gsub(/[ \t]+/," ", copy);
|
||
sub(/^[ \t]*/,"(", copy);
|
||
gsub(/\"/,"",copy);
|
||
sub(/ \(/," ",copy);
|
||
numargs = gsub(/SCM /,"", copy);
|
||
numcommas = gsub(/,/,"", copy);
|
||
numactuals = $2 + $3 + $4;
|
||
location = $5;
|
||
gsub(/\"/,"",location);
|
||
sub(/^[ \t]*/,"",location);
|
||
sub(/[ \t]*$/,"",location);
|
||
sub(/: /,":",location);
|
||
gsub(/[ \t]*\|.*$/,"",copy);
|
||
sub(/ )/,")",copy);
|
||
if (numargs != numactuals && !registering)
|
||
{ print location ":*** `" copy "' is improperly registered as having " numactuals " arguments"; }
|
||
print "\n" copy (registering?")":"") > dot_doc_file ; }
|
||
|
||
/@@@/,/@!!!.*$/ { copy = $0;
|
||
gsub(/.*@@@/,"",copy);
|
||
gsub(/^[ \t]*"?/,"", copy);
|
||
gsub(/\"?[ \t]*@!!!.*$/,"", copy);
|
||
gsub(/\\\"/,"\"",copy);
|
||
gsub(/[ \t]*$/,"", copy);
|
||
if (copy != "") { print copy > dot_doc_file } }
|
||
/@!!![ \t]/ { print "[" location "]" >> dot_doc_file; }
|
||
|