1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-05 11:40:20 +02:00
guile/libguile/guile-doc-snarf.awk
Greg J. Badros 4079f87ed2 * Makefile.am: Fix ETAGS_ARGS to recognize GUILE_PROC,
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.
1999-12-13 03:40:23 +00:00

51 lines
1.8 KiB
Awk
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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; }