mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-28 05:50:30 +02:00
* snarf.h (SCM_SNARF_DOCS): change the "grammar" slightly.
* guile-snarf-docs.in, guile-snarf-docs-texi.in: rewrite & simplify. * eval.c: all hash signs are in column 0. * Makefile.am (guile_filter_doc_snarfage): build using c-tokenize.c, not filter-doc-snarfage.c. rearrange snarfing dependencies a bit. * c-tokenize.lex: new file.
This commit is contained in:
parent
fc7a9e81a6
commit
ac13d9d210
7 changed files with 212 additions and 49 deletions
|
@ -24,37 +24,14 @@ bindir=`dirname $0`
|
|||
bindir=`(cd $bindir; pwd)`
|
||||
srcdir=`(cd $srcdir; pwd)`
|
||||
|
||||
temp0="/tmp/snarf.0.$$"
|
||||
temp1="/tmp/snarf.1.$$"
|
||||
trap "rm -f $temp0 $temp1" 0 1 2 15
|
||||
|
||||
# cat all the small files together:
|
||||
cat "$@" > ${temp1}
|
||||
|
||||
## massage the arglists
|
||||
|
||||
# lose the SCM types and commas, and texi-quote @'s in names and args
|
||||
< ${temp1} sed -e '/^arglist/s/[ ]*SCM[ ]*//g' \
|
||||
-e '/^arglist/s/,/ /g' \
|
||||
-e '/^arglist/s/([ ]*void[ ]*)/()/g' \
|
||||
-e '/^fname/s/@/@@/g' \
|
||||
-e '/^arglist/s/@/@@/g' \
|
||||
> ${temp0}
|
||||
|
||||
# nothing to do with the docstrings
|
||||
< ${temp0} sed -e 's/^string //' > ${temp1}
|
||||
|
||||
# we're too lame to check argpos assertions other then for straight names, so...
|
||||
< ${temp1} sed -e 's/^argpos.*[(\[].*//' > ${temp0}
|
||||
|
||||
echo "@paragraphindent 0"
|
||||
|
||||
# now run the script that will generate texinfo
|
||||
# run the script that will generate texinfo
|
||||
main='(module-ref (resolve-module '\''(scripts snarf-check-and-output-texi)) '\''main)'
|
||||
apply_main="(apply $main (cdr (command-line)))"
|
||||
|
||||
if [ `basename ${bindir}` = libguile ]; then
|
||||
GUILE_LOAD_PATH=${srcdir}/.. ${bindir}/guile -c "${apply_main}" < ${temp0}
|
||||
else
|
||||
${bindir}/guile -c "${apply_main}" < ${temp0}
|
||||
GUILE_LOAD_PATH=${srcdir}/..; export GUILE_LOAD_PATH
|
||||
fi
|
||||
|
||||
cat "$@" | ${bindir}/guile_filter_doc_snarfage --filter-snarfage | ${bindir}/guile -c "${apply_main}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue