mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-05 11:40:20 +02:00
* libguile/snarf.h: New macro `SCM_SNARF_INIT_PREFIX'. (SCM_SNARF_INIT) Use `SCM_SNARF_INIT_PREFIX' instead of including a literal marker. If the preprocessor echoes #define directives to its output, this will prevent `guile-snarf' from snarfing the `SCM_SNARF_INIT' definition itself. Reported by Mike Gran <spk121@yahoo.com>. * libguile/guile-snarf.in (modern_snarf): Don't output anything for lines in which only one of the magic snarfing markers is present. Modify the `sed' program for compatibility with POSIX `sed'. The new `sed' program is based on a version by Wolfgang Jenkner <wjenkner@inode.at>. * test-suite/standalone/test-guile-snarf: New tests.
22 lines
439 B
Bash
Executable file
22 lines
439 B
Bash
Executable file
#!/bin/sh
|
|
snarf ()
|
|
{
|
|
echo "$1" | guile-snarf - | tail -n +2 | tr -d ' \t\n'
|
|
}
|
|
|
|
snarf_test ()
|
|
{
|
|
x=`snarf "$1"`
|
|
if [ x"$x" != x"$2" ]; then
|
|
echo "Incorrect output: expected \"$2\", but got \"$x\""
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
snarf_test "^^a^:^" "a;"
|
|
snarf_test " ^ ^ b ^ : ^ " "b;"
|
|
snarf_test "c\n^^d^:^\ne" "d;"
|
|
snarf_test "f^^g^:^h" "g;"
|
|
snarf_test "^^i^:^j^^k^:^" "i;k;"
|
|
snarf_test "l^^m" ""
|
|
snarf_test "n^:^o" ""
|