1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 19:50:24 +02:00

* snarf.h, guile-snarf.awk.in, guile-snarf.in: Replaced snarf

markers with identifiers (SCM__I, SCM__D, SCM__S, SCM__E).
(Thanks to Bernard Urban.)
This commit is contained in:
Mikael Djurfeldt 2000-06-08 18:48:24 +00:00
parent 0abbd8f4a3
commit d80f396e99
3 changed files with 17 additions and 17 deletions

View file

@ -10,16 +10,16 @@ BEGIN { FS="|";
printf "" > dot_doc_file; printf "" > dot_doc_file;
} }
/^[ \t]* *% *% *%/ { copy = $0; /^[ \t]*SCM__I/ { copy = $0;
gsub(/[ \t]* *% *% *%/, "", copy); gsub(/[ \t]*SCM__I/, "", copy);
gsub(/ *\$ *\$ *\$.*$/, "", copy); gsub(/SCM__D.*$/, "", copy);
print copy; } print copy; }
/ *\$ *\$ *\$/,/ *@ *@ *@/ { copy = $0; /SCM__D/,/SCM__S/ { copy = $0;
if (match(copy,/ *\$ *\$ *\$R/)) { registering = 1; } if (match(copy,/SCM__DR/)) { registering = 1; }
else {registering = 0; } else {registering = 0; }
gsub(/.* *\$ *\$ *\$./,"", copy); gsub(/.*SCM__D./,"", copy);
gsub(/ *@ *@ *@.*/,"",copy); gsub(/SCM__S.*/,"",copy);
gsub(/[ \t]+/," ", copy); gsub(/[ \t]+/," ", copy);
sub(/^[ \t]*/,"(", copy); sub(/^[ \t]*/,"(", copy);
gsub(/\"/,"",copy); gsub(/\"/,"",copy);
@ -52,10 +52,10 @@ BEGIN { FS="|";
{ print location ":*** `" copy "' is improperly registered as having " numactuals " arguments" > std_err; } { print location ":*** `" copy "' is improperly registered as having " numactuals " arguments" > std_err; }
print " \n" copy (registering?")":"") > dot_doc_file ; } print " \n" copy (registering?")":"") > dot_doc_file ; }
/ *@ *@ *@/,/@ *! *! *!.*$/ { copy = $0; /SCM__S/,/SCM__E.*$/ { copy = $0;
gsub(/.* *@ *@ *@/,"",copy); gsub(/.*SCM__S/,"",copy);
sub(/^[ \t]*"?/,"", copy); sub(/^[ \t]*"?/,"", copy);
sub(/\"?[ \t]*@ *! *! *!.*$/,"", copy); sub(/\"?[ \t]*SCM__E.*$/,"", copy);
gsub(/\\n\\n"?/,"\n",copy); gsub(/\\n\\n"?/,"\n",copy);
gsub(/\\n"?[ \t]*$/,"",copy); gsub(/\\n"?[ \t]*$/,"",copy);
gsub(/\\\"[ \t]*$/,"\"",copy); gsub(/\\\"[ \t]*$/,"\"",copy);
@ -63,7 +63,7 @@ BEGIN { FS="|";
if (copy != "") { print copy > dot_doc_file } if (copy != "") { print copy > dot_doc_file }
} }
/@ *! *! *![ \t]/ { print "[" location "]" >> dot_doc_file; } /SCM__E[ \t]/ { print "[" location "]" >> dot_doc_file; }
/\*&\*&\*&\*SCM_ARG_BETTER_BE_IN_POSITION/ { copy = $0; /\*&\*&\*&\*SCM_ARG_BETTER_BE_IN_POSITION/ { copy = $0;
sub(/.*\*&\*&\*&\*SCM_ARG_BETTER_BE_IN_POSITION\([ \t]*/,"",copy); sub(/.*\*&\*&\*&\*SCM_ARG_BETTER_BE_IN_POSITION\([ \t]*/,"",copy);

View file

@ -10,7 +10,7 @@ test -n "${CPP+set}" || CPP="@CPP@"
## We must use a temporary file here, instead of a pipe, because we ## We must use a temporary file here, instead of a pipe, because we
## need to know if CPP exits with a non-zero status. ## need to know if CPP exits with a non-zero status.
${CPP} -DSCM_MAGIC_SNARFER "$@" > ${temp} || exit $? ${CPP} -DSCM_MAGIC_SNARFER "$@" > ${temp} || exit $?
< ${temp} grep "^ *% *% *%" | sed -e "s/^ *% *% *%//" -e 's/ *\$ *\$ *\$.*$//g' < ${temp} grep "^SCM__I" | sed -e "s/^SCM__I//" -e 's/SCM__D.*$//g'
## Apparently, AIX's preprocessor is unhappy if you try to #include an ## Apparently, AIX's preprocessor is unhappy if you try to #include an
## empty file. ## empty file.

View file

@ -67,7 +67,7 @@
* SCM_INIT (NAME = foo ()) * SCM_INIT (NAME = foo ())
* *
* The SCM_INIT text goes into the corresponding .x file * The SCM_INIT text goes into the corresponding .x file
* up through the first occurrence of $$$ on that line, if any. * up through the first occurrence of SCM__D on that line, if any.
*/ */
#ifndef SCM_MAGIC_SNARFER #ifndef SCM_MAGIC_SNARFER
@ -76,7 +76,7 @@
# define SCM_DOCS(X) # define SCM_DOCS(X)
#else #else
# define SCM_HERE(X) # define SCM_HERE(X)
# define SCM_INIT(X) %%% X # define SCM_INIT(X) SCM__I X
# define SCM_DOCS(X) X # define SCM_DOCS(X) X
#endif #endif
@ -89,7 +89,7 @@ SCM_INIT(\
scm_make_gsubr (s_ ## FNAME, REQ, OPT, VAR, (SCM_FUNC_CAST_ARBITRARY_ARGS) FNAME); \ scm_make_gsubr (s_ ## FNAME, REQ, OPT, VAR, (SCM_FUNC_CAST_ARBITRARY_ARGS) FNAME); \
)\ )\
SCM_DOCS(\ SCM_DOCS(\
$$$P PRIMNAME #ARGLIST | REQ | OPT | VAR | __FILE__:__LINE__ | @@@ DOCSTRING @!!! \ SCM__DP PRIMNAME #ARGLIST | REQ | OPT | VAR | __FILE__:__LINE__ | SCM__S DOCSTRING SCM__E \
) )
#define SCM_DEFINE1(FNAME, PRIMNAME, TYPE, ARGLIST, DOCSTRING) \ #define SCM_DEFINE1(FNAME, PRIMNAME, TYPE, ARGLIST, DOCSTRING) \
@ -99,7 +99,7 @@ SCM FNAME ARGLIST\
)\ )\
SCM_INIT(scm_make_subr (s_ ## FNAME, TYPE, FNAME); ) \ SCM_INIT(scm_make_subr (s_ ## FNAME, TYPE, FNAME); ) \
SCM_DOCS(\ SCM_DOCS(\
$$$1 PRIMNAME #ARGLIST | 2 | 0 | 0 | __FILE__:__LINE__ | @@@ DOCSTRING @!!! \ SCM__D1 PRIMNAME #ARGLIST | 2 | 0 | 0 | __FILE__:__LINE__ | SCM__S DOCSTRING SCM__E \
) )
#define SCM_PROC(RANAME, STR, REQ, OPT, VAR, CFN) \ #define SCM_PROC(RANAME, STR, REQ, OPT, VAR, CFN) \
@ -110,7 +110,7 @@ SCM_INIT(scm_make_gsubr (RANAME, REQ, OPT, VAR, (SCM_FUNC_CAST_ARBITRARY_ARGS) C
SCM_HERE(static const char RANAME[]=STR) \ SCM_HERE(static const char RANAME[]=STR) \
SCM_INIT(scm_make_gsubr (RANAME, REQ, OPT, VAR, (SCM_FUNC_CAST_ARBITRARY_ARGS) CFN);) \ SCM_INIT(scm_make_gsubr (RANAME, REQ, OPT, VAR, (SCM_FUNC_CAST_ARBITRARY_ARGS) CFN);) \
SCM_DOCS(\ SCM_DOCS(\
$$$R STR | REQ | OPT | VAR | __FILE__:__LINE__ | @@@ CFN @!!! \ SCM__DR STR | REQ | OPT | VAR | __FILE__:__LINE__ | SCM__S CFN SCM__E \
) )
#define SCM_GPROC(RANAME, STR, REQ, OPT, VAR, CFN, GF) \ #define SCM_GPROC(RANAME, STR, REQ, OPT, VAR, CFN, GF) \