Commit 076a0b55 076a0b559893edbb47b6d433c3e360fe871cd76d by Sergey Poznyakoff

(snarf_doc): Do not use \n in

the replacement part of a sed expression for the sake of older
seds. Use a more sophisticated approach with changing hold/pattern
spaces instead.
1 parent 4e9f0d50
......@@ -50,7 +50,28 @@ snarf_x() {
snarf_doc() {
$CPP -DSCM_MAGIC_SNARF_DOCS "$@" > ${temp}
cpp_exit=$?
sed -n '/\^^ *{.*^^ *}/{s,\^^,\n,pg}' $temp | \
sed -n '
/^ *^^ {.*/{
# First, remove the delimiting braces
s/^ *^^ {//
s/\^^ }/^^/
# Initialize the hold space
h
:beg
# Delete everything after the first ^^
s/\^^.*//
# Exchange spaces
x
# Delete up to the first ^^
s/[^^]*\^^//
# Append to the hold space and exchange
H
x
# Branch if the last substitution was successful
tbeg
# Otherwise, print the pattern space
p
}' $temp | \
$AWK -f $BASEDIR/guile-doc-snarf.awk
}
......