+2011-10-04 Bruno Haible <bruno@clisp.org>
+
+ xgettext for Scheme: Understand guile 2.0 comment syntax, part 1.
+ * x-scheme.c (read_object): Understand !# as a block comment terminator
+ even when not surrounded by newlines.
+ Reported by David Pirotte <david@altosw.be>
+ via Santiago Vila <sanvila@unex.es>.
+
2011-07-29 Bruno Haible <bruno@clisp.org>
Fix xgettext crash when extracting a message with plural that is
/* xgettext Scheme backend.
- Copyright (C) 2004-2009 Free Software Foundation, Inc.
+ Copyright (C) 2004-2009, 2011 Free Software Foundation, Inc.
This file was written by Bruno Haible <bruno@clisp.org>, 2004-2005.
/* The Scheme syntax is described in R5RS. It is implemented in
- guile-1.6.4/libguile/read.c.
+ guile-2.0.0/libguile/read.c.
Since we are interested only in strings and in forms similar to
(gettext msgid ...)
or (ngettext msgid msgid_plural ...)
- The syntax code assigned to each character, and how tokens are built
up from characters (single escape, multiple escape etc.).
- - Comment syntax: ';' and '#! ... \n!#\n'.
+ - Comment syntax: ';' and '#! ... !#'.
- String syntax: "..." with single escapes.
}
case '!':
- /* Block comment '#! ... \n!#\n'. We don't extract it
+ /* Block comment '#! ... !#'. We don't extract it
because it's only used to introduce scripts on Unix. */
{
- int last1 = 0;
- int last2 = 0;
- int last3 = 0;
+ int last = 0;
for (;;)
{
if (c == EOF)
/* EOF is not allowed here. But be tolerant. */
break;
- if (last3 == '\n' && last2 == '!' && last1 == '#'
- && c == '\n')
+ if (last == '!' && c == '#')
break;
- last3 = last2;
- last2 = last1;
- last1 = c;
+ last = c;
}
continue;
}