diff --git a/libguile/guile-doc-snarf.awk b/libguile/guile-doc-snarf.awk index 6f36c9cd0..9bd6e7b21 100644 --- a/libguile/guile-doc-snarf.awk +++ b/libguile/guile-doc-snarf.awk @@ -1,19 +1,29 @@ #!/usr/bin/awk -f +# Written by Greg J. Badros, +# 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 } +/^[ \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(/.\".*\"/, toupper("&"), copy); gsub(/\"/,"",copy); sub(/ \(/," ",copy); numargs = gsub(/SCM /,"", copy); @@ -21,16 +31,20 @@ BEGIN { FS="|"; numactuals = $2 + $3 + $4; location = $5; gsub(/\"/,"",location); - gsub(/^[ \t]*/,"",location); + sub(/^[ \t]*/,"",location); + sub(/[ \t]*$/,"",location); + sub(/: /,":",location); gsub(/[ \t]*\|.*$/,"",copy); - if (numargs != numactuals) { print location ":*** `" copy "' is improperly registered as having " numactuals " arguments"; } - print " " copy > dot_doc_file ; } + if (numargs != numactuals && !registering) + { print location ":*** `" copy "' is improperly registered as having " numactuals " arguments"; } + print " \n" copy (registering?")":"") > dot_doc_file ; } -/@@@/,/@!!![ \t]*$/ { copy = $0; +/@@@/,/@!!!.*$/ { copy = $0; gsub(/.*@@@/,"",copy); - gsub(/^"/,"", copy); - gsub(/\"[ \t]*@!!![ \t]*$/,"", copy); + gsub(/^[ \t]*"?/,"", copy); + gsub(/\"?[ \t]*@!!!.*$/,"", copy); gsub(/\\\"/,"\"",copy); - print copy > dot_doc_file ; } -/@!!![ \t]*$/ { print "[" location "]\n" >> dot_doc_file; } + gsub(/[ \t]*$/,"", copy); + if (copy != "") { print copy > dot_doc_file } } +/@!!![ \t]/ { print "[" location "]" >> dot_doc_file; } diff --git a/libguile/scm_validate.h b/libguile/scm_validate.h index 88d66f965..807a016b4 100644 --- a/libguile/scm_validate.h +++ b/libguile/scm_validate.h @@ -1,4 +1,4 @@ -/* $Id: scm_validate.h,v 1.5 1999-12-12 20:35:02 gjb Exp $ */ +/* $Id: scm_validate.h,v 1.6 1999-12-13 00:52:43 gjb Exp $ */ /* Copyright (C) 1999 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify @@ -93,8 +93,6 @@ -#ifndef SCM_DOCSTRING_SNARF - #define SCM_VALIDATE_NIM(pos,scm) \ do { SCM_ASSERT(SCM_NIMP(scm), scm, pos, FUNC_NAME); } while (0) @@ -310,5 +308,3 @@ do { SCM_ASSERT (SCM_NIMP (v) && SCM_VECTORP (v) && len == SCM_LENGTH(v), v, pos, FUNC_NAME); } while (0) #endif - -#endif diff --git a/libguile/snarf.h b/libguile/snarf.h index 2900820c1..dfc931e9e 100644 --- a/libguile/snarf.h +++ b/libguile/snarf.h @@ -82,7 +82,7 @@ $$$1 PRIMNAME #ARGLIST | 2 | 0 | 0 | __FILE__:__LINE__ | @@@ DOCSTRING @!!! #define SCM_REGISTER_PROC(RANAME, STR, REQ, OPT, VAR, CFN) \ %%% scm_make_gsubr (RANAME, REQ, OPT, VAR, (SCM (*)(...)) CFN); \ -$$$R RANAME CFN STR REQ OPT VAR @!!! +$$$R STR | REQ | OPT | VAR | __FILE__:__LINE__ | @@@ CFN @!!! #define SCM_GPROC(RANAME, STR, REQ, OPT, VAR, CFN, GF) \ %%% scm_make_gsubr_with_generic (RANAME, REQ, OPT, VAR, (SCM (*)(...))CFN, &GF) @@ -103,7 +103,7 @@ $$$1 PRIMNAME #ARGLIST | 2 | 0 | 0 | __FILE__:__LINE__ | @@@ DOCSTRING @!!! #define SCM_REGISTER_PROC(RANAME, STR, REQ, OPT, VAR, CFN) \ %%% scm_make_gsubr (RANAME, REQ, OPT, VAR, (SCM (*)()) CFN); \ -$$$R RANAME CFN STR REQ OPT VAR @!!! +$$$R STR | REQ | OPT | VAR | __FILE__:__LINE__ | @@@ CFN @!!! #define SCM_GPROC(RANAME, STR, REQ, OPT, VAR, CFN, GF) \ %%% scm_make_gsubr_with_generic (RANAME, REQ, OPT, VAR, (SCM (*)()) CFN, &GF)