1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 20:30:28 +02:00

* scm_validate.h: Drop the SCM_DOCSTRING_SNARF for turning off

SCM_VALIDATE macros;  the SCM_VALIDATE macros should be checked
for argument mismatches (along with the FUNC_NAME macro checking)
by a static tool that runs directly over the .c files.

* snarf.h: Handle SCM_REGISTER_PROC better when snarfing.  The
docstring is still missing from the .doc file;  it just gives the
name of the C function that gets called instead.

* guile-doc-snarf.awk: Be sure to touch the output files to help
make out.  Also handle SCM_REGISTER_PROC better, and change the
output format slightly.
This commit is contained in:
Greg J. Badros 1999-12-13 00:52:43 +00:00
parent 717050c8d5
commit eff08ab65d
3 changed files with 27 additions and 17 deletions

View file

@ -1,19 +1,29 @@
#!/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 }
/^[ \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; }

View file

@ -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

View file

@ -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)