+2003-06-15 Bruno Haible <bruno@clisp.org>
+
+ * xgettext.c (current_formatstring_parser1,
+ current_formatstring_parser2): New variables, replacing
+ current_formatstring_parser.
+ (remember_a_message, remember_a_message_plural): Try both
+ formatstring parsers.
+ (language_to_extractor): Allow two formatstring parsers per language,
+ not just one.
+ * x-perl.h (SCANNERS_PERL): Add formatstring_c as secondary format
+ string parser.
+ * x-awk.h (SCANNERS_AWK): Update.
+ * x-c.h (SCANNERS_C): Update.
+ * x-elisp.h (SCANNERS_ELISP): Update.
+ * x-glade.h (SCANNERS_GLADE): Update.
+ * x-java.h (SCANNERS_JAVA): Update.
+ * x-librep.h (SCANNERS_LIBREP): Update.
+ * x-lisp.h (SCANNERS_LISP): Update.
+ * x-php.h (SCANNERS_PHP): Update.
+ * x-po.h (SCANNERS_PO): Update.
+ * x-properties.h (SCANNERS_PROPERTIES): Update.
+ * x-python.h (SCANNERS_PYTHON): Update.
+ * x-rst.h (SCANNERS_RST): Update.
+ * x-smalltalk.h (SCANNERS_SMALLTALK): Update.
+ * x-tcl.h (SCANNERS_TCL): Update.
+ * x-ycp.h (SCANNERS_YCP): Update.
+
2003-06-15 Bruno Haible <bruno@clisp.org>
* x-perl.c (case_whitespace): New macro.
/* xgettext awk backend.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2002.
This program is free software; you can redistribute it and/or modify
{ "awk", "awk" }, \
#define SCANNERS_AWK \
- { "awk", extract_awk, &formatstring_awk }, \
+ { "awk", extract_awk, &formatstring_awk, NULL }, \
/* Scan an awk file and add its translatable strings to mdlp. */
extern void extract_awk (FILE *fp, const char *real_filename,
/* xgettext C/C++/ObjectiveC backend.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
{ "m", "ObjectiveC" }, \
#define SCANNERS_C \
- { "C", extract_c, &formatstring_c }, \
- { "C++", extract_c, &formatstring_c }, \
- { "ObjectiveC", extract_c, &formatstring_c }, \
+ { "C", extract_c, &formatstring_c, NULL }, \
+ { "C++", extract_c, &formatstring_c, NULL }, \
+ { "ObjectiveC", extract_c, &formatstring_c, NULL }, \
/* Scan a C/C++/ObjectiveC file and add its translatable strings to mdlp. */
extern void extract_c (FILE *fp, const char *real_filename,
/* xgettext Emacs Lisp backend.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2002.
This program is free software; you can redistribute it and/or modify
{ "el", "EmacsLisp" }, \
#define SCANNERS_ELISP \
- { "EmacsLisp", extract_elisp, &formatstring_elisp }, \
+ { "EmacsLisp", extract_elisp, &formatstring_elisp, NULL }, \
/* Scan an Emacs Lisp file and add its translatable strings to mdlp. */
extern void extract_elisp (FILE *fp, const char *real_filename,
{ "glade2", "glade" }, \
#define SCANNERS_GLADE \
- { "glade", extract_glade, NULL }, \
+ { "glade", extract_glade, NULL, NULL }, \
/* Scan a glade XML file and add its translatable strings to mdlp. */
extern void extract_glade (FILE *fp, const char *real_filename,
/* xgettext Java backend.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003 Free Software Foundation, Inc.
Written by Tommy Johansson <tommy.johansson@kanalen.org>, 2001.
This program is free software; you can redistribute it and/or modify
{ "java", "Java" }, \
#define SCANNERS_JAVA \
- { "Java", extract_java, &formatstring_java }, \
+ { "Java", extract_java, &formatstring_java, NULL }, \
extern void extract_java (FILE *fp, const char *real_filename,
const char *logical_filename,
/* xgettext librep backend.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
{ "jl", "librep" }, \
#define SCANNERS_LIBREP \
- { "librep", extract_librep, &formatstring_librep }, \
+ { "librep", extract_librep, &formatstring_librep, NULL }, \
/* Scan a librep file and add its translatable strings to mdlp. */
extern void extract_librep (FILE *fp, const char *real_filename,
/* xgettext Lisp backend.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
{ "lisp", "Lisp" }, \
#define SCANNERS_LISP \
- { "Lisp", extract_lisp, &formatstring_lisp }, \
+ { "Lisp", extract_lisp, &formatstring_lisp, NULL }, \
/* Scan a Lisp file and add its translatable strings to mdlp. */
extern void extract_lisp (FILE *fp, const char *real_filename,
{ "cgi", "perl" }, \
#define SCANNERS_PERL \
- { "perl", extract_perl, &formatstring_perl }, \
+ { "perl", extract_perl, &formatstring_c, &formatstring_perl }, \
/* Scan a Perl file and add its translatable strings to mdlp. */
extern void extract_perl (FILE *fp, const char *real_filename,
/* xgettext PHP backend.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This program is free software; you can redistribute it and/or modify
{ "php4", "PHP" }, \
#define SCANNERS_PHP \
- { "PHP", extract_php, &formatstring_php }, \
+ { "PHP", extract_php, &formatstring_php, NULL }, \
/* Scan a PHP file and add its translatable strings to mdlp. */
extern void extract_php (FILE *fp, const char *real_filename,
/* xgettext PO backend.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
{ "pot", "PO" }, \
#define SCANNERS_PO \
- { "PO", extract_po, NULL }, \
+ { "PO", extract_po, NULL, NULL }, \
/* Scan a PO file and add its translatable strings to mdlp. */
extern void extract_po (FILE *fp, const char *real_filename,
{ "properties", "JavaProperties" }, \
#define SCANNERS_PROPERTIES \
- { "JavaProperties", extract_properties, NULL }, \
+ { "JavaProperties", extract_properties, NULL, NULL }, \
/* Scan a JavaProperties file and add its translatable strings to mdlp. */
extern void extract_properties (FILE *fp, const char *real_filename,
/* xgettext Python backend.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2002.
This program is free software; you can redistribute it and/or modify
{ "py", "Python" }, \
#define SCANNERS_PYTHON \
- { "Python", extract_python, &formatstring_python }, \
+ { "Python", extract_python, &formatstring_python, NULL }, \
/* Scan a Python file and add its translatable strings to mdlp. */
extern void extract_python (FILE *fp, const char *real_filename,
/* xgettext RST backend.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
{ "rst", "RST" }, \
#define SCANNERS_RST \
- { "RST", extract_rst, &formatstring_pascal }, \
+ { "RST", extract_rst, &formatstring_pascal, NULL }, \
/* Scan an RST file and add its translatable strings to mdlp. */
extern void extract_rst (FILE *fp, const char *real_filename,
/* xgettext Smalltalk backend.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2002.
This program is free software; you can redistribute it and/or modify
{ "st", "Smalltalk" }, \
#define SCANNERS_SMALLTALK \
- { "Smalltalk", extract_smalltalk, &formatstring_smalltalk }, \
+ { "Smalltalk", extract_smalltalk, &formatstring_smalltalk, NULL }, \
/* Scan a Smalltalk file and add its translatable strings to mdlp. */
extern void extract_smalltalk (FILE *fp, const char *real_filename,
/* xgettext Tcl Lisp backend.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2002.
This program is free software; you can redistribute it and/or modify
{ "tcl", "Tcl" }, \
#define SCANNERS_TCL \
- { "Tcl", extract_tcl, &formatstring_tcl }, \
+ { "Tcl", extract_tcl, &formatstring_tcl, NULL }, \
/* Scan a Tcl file and add its translatable strings to mdlp. */
extern void extract_tcl (FILE *fp, const char *real_filename,
/* xgettext YCP backend.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
{ "ycp", "YCP" }, \
#define SCANNERS_YCP \
- { "YCP", extract_ycp, &formatstring_ycp }, \
+ { "YCP", extract_ycp, &formatstring_ycp, NULL }, \
/* Scan an YCP file and add its translatable strings to mdlp. */
extern void extract_ycp (FILE *fp, const char *real_filename,
/* Language dependent format string parser.
NULL if the language has no notion of format strings. */
-static struct formatstring_parser *current_formatstring_parser;
+static struct formatstring_parser *current_formatstring_parser1;
+static struct formatstring_parser *current_formatstring_parser2;
/* Convert the given string from xgettext_current_source_encoding to
for (i = 0; i < NFORMATS; i++)
{
if (is_format[i] == undecided
- && formatstring_parsers[i] == current_formatstring_parser)
+ && (formatstring_parsers[i] == current_formatstring_parser1
+ || formatstring_parsers[i] == current_formatstring_parser2))
{
struct formatstring_parser *parser = formatstring_parsers[i];
char *invalid_reason = NULL;
the msgid, whether the msgid is a format string, examine the
msgid_plural. This is a heuristic. */
for (i = 0; i < NFORMATS; i++)
- if (formatstring_parsers[i] == current_formatstring_parser
+ if ((formatstring_parsers[i] == current_formatstring_parser1
+ || formatstring_parsers[i] == current_formatstring_parser2)
&& (mp->is_format[i] == undecided || mp->is_format[i] == possible))
{
struct formatstring_parser *parser = formatstring_parsers[i];
{
const char *name;
extractor_func func;
- struct formatstring_parser *formatstring_parser;
+ struct formatstring_parser *formatstring_parser1;
+ struct formatstring_parser *formatstring_parser2;
};
static table_ty table[] =
if (strcasecmp (name, tp->name) == 0)
{
/* XXX Ugly side effect. */
- current_formatstring_parser = tp->formatstring_parser;
+ current_formatstring_parser1 = tp->formatstring_parser1;
+ current_formatstring_parser2 = tp->formatstring_parser2;
return tp->func;
}