1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 06:20:23 +02:00

* guile-snarf.awk.in, guile-snarf.in: Made to work also for

preprocessors which interpret $$$ and other markers as three
separate tokens and puts spaces in between.  NOTE: We could
replace %%% etc with real identifiers.  However, before the 1.4
release, we instead make minimal changes to the existing
system. (Thanks to Bernard Urban.)
This commit is contained in:
Mikael Djurfeldt 2000-06-08 16:50:49 +00:00
parent 0bf8b97450
commit 7180cf39a7
2 changed files with 12 additions and 12 deletions

View file

@ -10,16 +10,16 @@ BEGIN { FS="|";
printf "" > dot_doc_file;
}
/^[ \t]*%%%/ { copy = $0;
gsub(/[ \t]*%%%/, "", copy);
gsub(/\$\$\$.*$/, "", copy);
/^[ \t]* *% *% *%/ { copy = $0;
gsub(/[ \t]* *% *% *%/, "", copy);
gsub(/ *\$ *\$ *\$.*$/, "", copy);
print copy; }
/\$\$\$/,/@@@/ { copy = $0;
if (match(copy,/\$\$\$R/)) { registering = 1; }
/ *\$ *\$ *\$/,/ *@ *@ *@/ { copy = $0;
if (match(copy,/ *\$ *\$ *\$R/)) { registering = 1; }
else {registering = 0; }
gsub(/.*\$\$\$./,"", copy);
gsub(/@@@.*/,"",copy);
gsub(/.* *\$ *\$ *\$./,"", copy);
gsub(/ *@ *@ *@.*/,"",copy);
gsub(/[ \t]+/," ", copy);
sub(/^[ \t]*/,"(", copy);
gsub(/\"/,"",copy);
@ -52,10 +52,10 @@ BEGIN { FS="|";
{ print location ":*** `" copy "' is improperly registered as having " numactuals " arguments" > std_err; }
print " \n" copy (registering?")":"") > dot_doc_file ; }
/@@@/,/@!!!.*$/ { copy = $0;
gsub(/.*@@@/,"",copy);
/ *@ *@ *@/,/@ *! *! *!.*$/ { copy = $0;
gsub(/.* *@ *@ *@/,"",copy);
sub(/^[ \t]*"?/,"", copy);
sub(/\"?[ \t]*@!!!.*$/,"", copy);
sub(/\"?[ \t]*@ *! *! *!.*$/,"", copy);
gsub(/\\n\\n"?/,"\n",copy);
gsub(/\\n"?[ \t]*$/,"",copy);
gsub(/\\\"[ \t]*$/,"\"",copy);
@ -63,7 +63,7 @@ BEGIN { FS="|";
if (copy != "") { print copy > dot_doc_file }
}
/@!!![ \t]/ { print "[" location "]" >> dot_doc_file; }
/@ *! *! *![ \t]/ { print "[" location "]" >> dot_doc_file; }
/\*&\*&\*&\*SCM_ARG_BETTER_BE_IN_POSITION/ { copy = $0;
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
## need to know if CPP exits with a non-zero status.
${CPP} -DSCM_MAGIC_SNARFER "$@" > ${temp} || exit $?
< ${temp} grep "^ *% *% *%" | sed -e "s/^ *% *% *%//" -e 's/\$\$\$.*$//g'
< ${temp} grep "^ *% *% *%" | sed -e "s/^ *% *% *%//" -e 's/ *\$ *\$ *\$.*$//g'
## Apparently, AIX's preprocessor is unhappy if you try to #include an
## empty file.