summaryrefslogtreecommitdiffstats
path: root/gettext-tools/src
diff options
context:
space:
mode:
Diffstat (limited to 'gettext-tools/src')
-rw-r--r--gettext-tools/src/ChangeLog76
-rw-r--r--gettext-tools/src/x-awk.c20
-rw-r--r--gettext-tools/src/x-elisp.c10
-rw-r--r--gettext-tools/src/x-glade.c12
-rw-r--r--gettext-tools/src/x-librep.c10
-rw-r--r--gettext-tools/src/x-lisp.c10
-rw-r--r--gettext-tools/src/x-perl.c16
-rw-r--r--gettext-tools/src/x-php.c18
-rw-r--r--gettext-tools/src/x-scheme.c10
-rw-r--r--gettext-tools/src/x-sh.c12
-rw-r--r--gettext-tools/src/x-smalltalk.c12
-rw-r--r--gettext-tools/src/x-tcl.c10
-rw-r--r--gettext-tools/src/x-ycp.c16
13 files changed, 195 insertions, 37 deletions
diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog
index bb13df5..7763b43 100644
--- a/gettext-tools/src/ChangeLog
+++ b/gettext-tools/src/ChangeLog
@@ -1,5 +1,81 @@
2005-10-03 Bruno Haible <bruno@clisp.org>
+ Use savable_comment_* API instead of xgettext_comment_* API.
+ * x-awk.c (phase2_getc): Call savable_comment_add instead of
+ xgettext_comment_add.
+ (x_awk_lex): Call savable_comment_reset instead of
+ xgettext_comment_reset.
+ (extract_parenthesized): Call savable_comment_to_xgettext_comment and
+ savable_comment_reset around remember_a_message.
+ * x-elisp.c (comment_line_end): Call savable_comment_add instead of
+ xgettext_comment_add.
+ (read_object): Call savable_comment_reset instead of
+ xgettext_comment_reset. Call savable_comment_to_xgettext_comment and
+ savable_comment_reset around remember_a_message.
+ * x-glade.c (start_element_handler, end_element_handler): Call
+ savable_comment_to_xgettext_comment and savable_comment_reset around
+ remember_a_message. Call savable_comment_reset instead of
+ xgettext_comment_reset.
+ (comment_handler): Call savable_comment_add instead of
+ xgettext_comment_add.
+ * x-librep.c (comment_line_end): Call savable_comment_add instead of
+ xgettext_comment_add.
+ (read_object): Call savable_comment_reset instead of
+ xgettext_comment_reset. Call savable_comment_to_xgettext_comment and
+ savable_comment_reset around remember_a_message.
+ * x-lisp.c (comment_line_end): Call savable_comment_add instead of
+ xgettext_comment_add.
+ (read_object): Call savable_comment_reset instead of
+ xgettext_comment_reset. Call savable_comment_to_xgettext_comment and
+ savable_comment_reset around remember_a_message.
+ * x-perl.c (phase2_getc): Call savable_comment_add instead of
+ xgettext_comment_add.
+ (extract_variable, interpolate_keywords): Call
+ savable_comment_to_xgettext_comment and savable_comment_reset around
+ remember_a_message.
+ (x_perl_prelex): Call savable_comment_reset instead of
+ xgettext_comment_reset.
+ (extract_balanced): Call savable_comment_to_xgettext_comment and
+ savable_comment_reset around remember_a_message.
+ * x-php.c (comment_line_end): Call savable_comment_add instead of
+ xgettext_comment_add.
+ (x_php_lex): Call savable_comment_reset instead of
+ xgettext_comment_reset.
+ (extract_parenthesized): Call savable_comment_to_xgettext_comment and
+ savable_comment_reset around remember_a_message.
+ * x-scheme.c (comment_line_end): Call savable_comment_add instead of
+ xgettext_comment_add.
+ (read_object): Call savable_comment_reset instead of
+ xgettext_comment_reset. Call savable_comment_to_xgettext_comment and
+ savable_comment_reset around remember_a_message.
+ * x-sh.c (comment_line_end): Call savable_comment_add instead of
+ xgettext_comment_add.
+ (read_word): Call savable_comment_reset instead of
+ xgettext_comment_reset. Call savable_comment_to_xgettext_comment and
+ savable_comment_reset around remember_a_message.
+ (read_command): Call savable_comment_to_xgettext_comment and
+ savable_comment_reset around remember_a_message.
+ * x-smalltalk.c (comment_line_end): Call savable_comment_add instead of
+ xgettext_comment_add.
+ (phase2_get): Call savable_comment_reset instead of
+ xgettext_comment_reset.
+ (extract_smalltalk): Call savable_comment_to_xgettext_comment and
+ savable_comment_reset around remember_a_message.
+ * x-tcl.c (comment_line_end): Call savable_comment_add instead of
+ xgettext_comment_add.
+ (read_word): Call savable_comment_reset instead of
+ xgettext_comment_reset.
+ (read_command): Call savable_comment_to_xgettext_comment and
+ savable_comment_reset around remember_a_message.
+ * x-ycp.c (phase2_getc): Call savable_comment_add instead of
+ xgettext_comment_add.
+ (x_ycp_lex): Call savable_comment_reset instead of
+ xgettext_comment_reset.
+ (extract_parenthesized): Call savable_comment_to_xgettext_comment and
+ savable_comment_reset around remember_a_message.
+
+2005-10-03 Bruno Haible <bruno@clisp.org>
+
* message.c (message_list_hash_insert_entry): Update.
2005-10-03 Bruno Haible <bruno@clisp.org>
diff --git a/gettext-tools/src/x-awk.c b/gettext-tools/src/x-awk.c
index 95c9bc1..9f98148 100644
--- a/gettext-tools/src/x-awk.c
+++ b/gettext-tools/src/x-awk.c
@@ -205,7 +205,7 @@ phase2_getc ()
buffer = xrealloc (buffer, bufmax);
}
buffer[buflen] = '\0';
- xgettext_comment_add (buffer);
+ savable_comment_add (buffer);
last_comment_line = lineno;
}
return c;
@@ -400,7 +400,7 @@ x_awk_lex (token_ty *tp)
case '\n':
if (last_non_comment_line > last_comment_line)
- xgettext_comment_reset ();
+ savable_comment_reset ();
/* Newline is not allowed inside expressions. It usually
introduces a fresh statement.
FIXME: Newlines after any of ',' '{' '?' ':' '||' '&&' 'do' 'else'
@@ -812,7 +812,11 @@ extract_parenthesized (message_list_ty *mlp,
pos.line_number = token.line_number;
if (extract_all)
- remember_a_message (mlp, token.string, inner_context, &pos);
+ {
+ savable_comment_to_xgettext_comment (savable_comment);
+ remember_a_message (mlp, token.string, inner_context, &pos);
+ savable_comment_reset ();
+ }
else
{
if (commas_to_skip == 0)
@@ -820,17 +824,23 @@ extract_parenthesized (message_list_ty *mlp,
if (plural_mp == NULL)
{
/* Seen an msgid. */
- message_ty *mp =
+ message_ty *mp;
+
+ savable_comment_to_xgettext_comment (savable_comment);
+ mp =
remember_a_message (mlp, token.string,
inner_context, &pos);
+ savable_comment_reset ();
if (plural_commas > 0)
plural_mp = mp;
}
else
{
/* Seen an msgid_plural. */
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message_plural (plural_mp, token.string,
inner_context, &pos);
+ savable_comment_reset ();
plural_mp = NULL;
}
}
@@ -849,7 +859,9 @@ extract_parenthesized (message_list_ty *mlp,
pos.file_name = logical_file_name;
pos.line_number = token.line_number;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message (mlp, token.string, inner_context, &pos);
+ savable_comment_reset ();
}
next_is_argument = false;
next_context_iter = null_context_list_iterator;
diff --git a/gettext-tools/src/x-elisp.c b/gettext-tools/src/x-elisp.c
index a27fa1e..8ce48a3 100644
--- a/gettext-tools/src/x-elisp.c
+++ b/gettext-tools/src/x-elisp.c
@@ -365,7 +365,7 @@ comment_line_end (size_t chars_to_remove)
buffer = xrealloc (buffer, bufmax);
}
buffer[buflen] = '\0';
- xgettext_comment_add (buffer);
+ savable_comment_add (buffer);
}
@@ -639,7 +639,7 @@ read_object (struct object *op, bool first_in_list, bool new_backquote_flag,
precede it, with no non-whitespace token on a line between
both. */
if (last_non_comment_line > last_comment_line)
- xgettext_comment_reset ();
+ savable_comment_reset ();
continue;
case '(':
@@ -724,8 +724,10 @@ read_object (struct object *op, bool first_in_list, bool new_backquote_flag,
pos.file_name = logical_file_name;
pos.line_number = inner.line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
mp = remember_a_message (mlp, string_of_object (&inner),
inner_context, &pos);
+ savable_comment_reset ();
if (argnum2 > 0)
plural_mp = mp;
}
@@ -738,8 +740,10 @@ read_object (struct object *op, bool first_in_list, bool new_backquote_flag,
pos.file_name = logical_file_name;
pos.line_number = inner.line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message_plural (plural_mp, string_of_object (&inner),
inner_context, &pos);
+ savable_comment_reset ();
}
}
}
@@ -920,8 +924,10 @@ read_object (struct object *op, bool first_in_list, bool new_backquote_flag,
pos.file_name = logical_file_name;
pos.line_number = op->line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message (mlp, string_of_object (op),
null_context, &pos);
+ savable_comment_reset ();
}
last_non_comment_line = line_number;
return;
diff --git a/gettext-tools/src/x-glade.c b/gettext-tools/src/x-glade.c
index 1f6648a..314ff74 100644
--- a/gettext-tools/src/x-glade.c
+++ b/gettext-tools/src/x-glade.c
@@ -268,8 +268,10 @@ start_element_handler (void *userData, const char *name,
pos.file_name = logical_file_name;
pos.line_number = XML_GetCurrentLineNumber (parser);
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message (mlp, xstrdup (attp[1]),
null_context, &pos);
+ savable_comment_reset ();
}
break;
}
@@ -281,7 +283,7 @@ start_element_handler (void *userData, const char *name,
p->bufmax = 0;
p->buflen = 0;
if (!p->extract_string)
- xgettext_comment_reset ();
+ savable_comment_reset ();
}
/* Callback called when </element> is seen. */
@@ -305,7 +307,9 @@ end_element_handler (void *userData, const char *name)
pos.file_name = logical_file_name;
pos.line_number = p->lineno;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message (mlp, p->buffer, null_context, &pos);
+ savable_comment_reset ();
p->buffer = NULL;
}
}
@@ -317,7 +321,7 @@ end_element_handler (void *userData, const char *name)
/* Decrease stack depth. */
stack_depth--;
- xgettext_comment_reset ();
+ savable_comment_reset ();
}
/* Callback called when some text is seen. */
@@ -358,7 +362,7 @@ comment_handler (void *userData, const char *data)
while (q > p && (q[-1] == ' ' || q[-1] == '\t'))
q--;
*q = '\0';
- xgettext_comment_add (p);
+ savable_comment_add (p);
}
q = p + strlen (p);
while (p[0] == ' ' || p[0] == '\t')
@@ -366,7 +370,7 @@ comment_handler (void *userData, const char *data)
while (q > p && (q[-1] == ' ' || q[-1] == '\t'))
q--;
*q = '\0';
- xgettext_comment_add (p);
+ savable_comment_add (p);
free (copy);
}
diff --git a/gettext-tools/src/x-librep.c b/gettext-tools/src/x-librep.c
index 8ef65d4..a344b88 100644
--- a/gettext-tools/src/x-librep.c
+++ b/gettext-tools/src/x-librep.c
@@ -446,7 +446,7 @@ comment_line_end (size_t chars_to_remove)
buffer = xrealloc (buffer, bufmax);
}
buffer[buflen] = '\0';
- xgettext_comment_add (buffer);
+ savable_comment_add (buffer);
}
@@ -611,7 +611,7 @@ read_object (struct object *op, flag_context_ty outer_context)
precede it, with no non-whitespace token on a line between
both. */
if (last_non_comment_line > last_comment_line)
- xgettext_comment_reset ();
+ savable_comment_reset ();
continue;
case ' ': case '\t': case '\f': case '\r':
@@ -698,8 +698,10 @@ read_object (struct object *op, flag_context_ty outer_context)
pos.file_name = logical_file_name;
pos.line_number = inner.line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
mp = remember_a_message (mlp, string_of_object (&inner),
inner_context, &pos);
+ savable_comment_reset ();
if (argnum2 > 0)
plural_mp = mp;
}
@@ -712,8 +714,10 @@ read_object (struct object *op, flag_context_ty outer_context)
pos.file_name = logical_file_name;
pos.line_number = inner.line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message_plural (plural_mp, string_of_object (&inner),
inner_context, &pos);
+ savable_comment_reset ();
}
}
}
@@ -856,8 +860,10 @@ read_object (struct object *op, flag_context_ty outer_context)
pos.file_name = logical_file_name;
pos.line_number = op->line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message (mlp, string_of_object (op),
null_context, &pos);
+ savable_comment_reset ();
}
last_non_comment_line = line_number;
return;
diff --git a/gettext-tools/src/x-lisp.c b/gettext-tools/src/x-lisp.c
index 2617b21..f903b55 100644
--- a/gettext-tools/src/x-lisp.c
+++ b/gettext-tools/src/x-lisp.c
@@ -860,7 +860,7 @@ comment_line_end (size_t chars_to_remove)
buffer = xrealloc (buffer, bufmax);
}
buffer[buflen] = '\0';
- xgettext_comment_add (buffer);
+ savable_comment_add (buffer);
}
@@ -954,7 +954,7 @@ read_object (struct object *op, flag_context_ty outer_context)
precede it, with no non-whitespace token on a line between
both. */
if (last_non_comment_line > last_comment_line)
- xgettext_comment_reset ();
+ savable_comment_reset ();
continue;
case syntax_illegal:
@@ -1100,8 +1100,10 @@ read_object (struct object *op, flag_context_ty outer_context)
pos.file_name = logical_file_name;
pos.line_number = inner.line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
mp = remember_a_message (mlp, string_of_object (&inner),
inner_context, &pos);
+ savable_comment_reset ();
if (argnum2 > 0)
plural_mp = mp;
}
@@ -1114,8 +1116,10 @@ read_object (struct object *op, flag_context_ty outer_context)
pos.file_name = logical_file_name;
pos.line_number = inner.line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message_plural (plural_mp, string_of_object (&inner),
inner_context, &pos);
+ savable_comment_reset ();
}
}
}
@@ -1215,8 +1219,10 @@ read_object (struct object *op, flag_context_ty outer_context)
pos.file_name = logical_file_name;
pos.line_number = op->line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message (mlp, string_of_object (op),
null_context, &pos);
+ savable_comment_reset ();
}
last_non_comment_line = line_number;
return;
diff --git a/gettext-tools/src/x-perl.c b/gettext-tools/src/x-perl.c
index cc7d410..d714794 100644
--- a/gettext-tools/src/x-perl.c
+++ b/gettext-tools/src/x-perl.c
@@ -472,9 +472,7 @@ phase2_getc ()
utf8_string =
from_current_source_encoding (buffer, logical_file_name, lineno);
/* Save it until we encounter the corresponding string. */
- xgettext_current_source_encoding = po_charset_utf8;
- xgettext_comment_add (utf8_string);
- xgettext_current_source_encoding = xgettext_global_source_encoding;
+ savable_comment_add (utf8_string);
last_comment_line = lineno;
}
return c;
@@ -1533,7 +1531,9 @@ extract_variable (message_list_ty *mlp, token_ty *tp, int first)
pos.file_name = logical_file_name;
xgettext_current_source_encoding = po_charset_utf8;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message (mlp, xstrdup (t1->string), context, &pos);
+ savable_comment_reset ();
xgettext_current_source_encoding = xgettext_global_source_encoding;
free_token (t2);
free_token (t1);
@@ -1954,7 +1954,9 @@ interpolate_keywords (message_list_ty *mlp, const char *string, int lineno)
token.string = xstrdup (buffer);
extract_quotelike_pass3 (&token, EXIT_FAILURE);
xgettext_current_source_encoding = po_charset_utf8;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message (mlp, token.string, context, &pos);
+ savable_comment_reset ();
xgettext_current_source_encoding = xgettext_global_source_encoding;
/* FALLTHROUGH */
default:
@@ -1994,7 +1996,7 @@ x_perl_prelex (message_list_ty *mlp, token_ty *tp)
case '\n':
if (last_non_comment_line > last_comment_line)
- xgettext_comment_reset ();
+ savable_comment_reset ();
/* FALLTHROUGH */
case '\t':
case ' ':
@@ -2983,7 +2985,9 @@ extract_balanced (message_list_ty *mlp, int state, token_type_ty delim,
pos.line_number = tp->line_number;
string = collect_message (mlp, tp, EXIT_SUCCESS);
xgettext_current_source_encoding = po_charset_utf8;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message (mlp, string, inner_context, &pos);
+ savable_comment_reset ();
xgettext_current_source_encoding = xgettext_global_source_encoding;
}
else if (state)
@@ -2998,7 +3002,9 @@ extract_balanced (message_list_ty *mlp, int state, token_type_ty delim,
{
string = collect_message (mlp, tp, EXIT_FAILURE);
xgettext_current_source_encoding = po_charset_utf8;
+ savable_comment_to_xgettext_comment (savable_comment);
plural_mp = remember_a_message (mlp, string, inner_context, &pos);
+ savable_comment_reset ();
xgettext_current_source_encoding = xgettext_global_source_encoding;
arg_sg = -1;
}
@@ -3011,7 +3017,9 @@ extract_balanced (message_list_ty *mlp, int state, token_type_ty delim,
string = collect_message (mlp, tp, EXIT_FAILURE);
xgettext_current_source_encoding = po_charset_utf8;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message_plural (plural_mp, string, inner_context, &pos);
+ savable_comment_reset ();
xgettext_current_source_encoding = xgettext_global_source_encoding;
arg_pl = -1;
}
diff --git a/gettext-tools/src/x-php.c b/gettext-tools/src/x-php.c
index a0b9397..8091260 100644
--- a/gettext-tools/src/x-php.c
+++ b/gettext-tools/src/x-php.c
@@ -565,7 +565,7 @@ comment_line_end (size_t chars_to_remove)
buffer = xrealloc (buffer, bufmax);
}
buffer[buflen] = '\0';
- xgettext_comment_add (buffer);
+ savable_comment_add (buffer);
}
@@ -785,7 +785,7 @@ x_php_lex (token_ty *tp)
case '\n':
if (last_non_comment_line > last_comment_line)
- xgettext_comment_reset ();
+ savable_comment_reset ();
/* FALLTHROUGH */
case ' ':
case '\t':
@@ -1320,7 +1320,11 @@ extract_parenthesized (message_list_ty *mlp,
pos.line_number = token.line_number;
if (extract_all)
- remember_a_message (mlp, token.string, inner_context, &pos);
+ {
+ savable_comment_to_xgettext_comment (savable_comment);
+ remember_a_message (mlp, token.string, inner_context, &pos);
+ savable_comment_reset ();
+ }
else
{
if (commas_to_skip == 0)
@@ -1328,17 +1332,23 @@ extract_parenthesized (message_list_ty *mlp,
if (plural_mp == NULL)
{
/* Seen an msgid. */
- message_ty *mp =
+ message_ty *mp;
+
+ savable_comment_to_xgettext_comment (savable_comment);
+ mp =
remember_a_message (mlp, token.string,
inner_context, &pos);
+ savable_comment_reset ();
if (plural_commas > 0)
plural_mp = mp;
}
else
{
/* Seen an msgid_plural. */
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message_plural (plural_mp, token.string,
inner_context, &pos);
+ savable_comment_reset ();
plural_mp = NULL;
}
}
diff --git a/gettext-tools/src/x-scheme.c b/gettext-tools/src/x-scheme.c
index 113509e..f77d5d6 100644
--- a/gettext-tools/src/x-scheme.c
+++ b/gettext-tools/src/x-scheme.c
@@ -609,7 +609,7 @@ comment_line_end (size_t chars_to_remove)
buffer = xrealloc (buffer, bufmax);
}
buffer[buflen] = '\0';
- xgettext_comment_add (buffer);
+ savable_comment_add (buffer);
}
@@ -699,7 +699,7 @@ read_object (struct object *op, flag_context_ty outer_context)
precede it, with no non-whitespace token on a line between
both. */
if (last_non_comment_line > last_comment_line)
- xgettext_comment_reset ();
+ savable_comment_reset ();
continue;
case ';':
@@ -807,8 +807,10 @@ read_object (struct object *op, flag_context_ty outer_context)
pos.file_name = logical_file_name;
pos.line_number = inner.line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
mp = remember_a_message (mlp, string_of_object (&inner),
inner_context, &pos);
+ savable_comment_reset ();
if (argnum2 > 0)
plural_mp = mp;
}
@@ -821,8 +823,10 @@ read_object (struct object *op, flag_context_ty outer_context)
pos.file_name = logical_file_name;
pos.line_number = inner.line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message_plural (plural_mp, string_of_object (&inner),
inner_context, &pos);
+ savable_comment_reset ();
}
}
}
@@ -1154,8 +1158,10 @@ read_object (struct object *op, flag_context_ty outer_context)
pos.file_name = logical_file_name;
pos.line_number = op->line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message (mlp, string_of_object (op),
null_context, &pos);
+ savable_comment_reset ();
}
last_non_comment_line = line_number;
return;
diff --git a/gettext-tools/src/x-sh.c b/gettext-tools/src/x-sh.c
index 6f0b82e..51f94b8 100644
--- a/gettext-tools/src/x-sh.c
+++ b/gettext-tools/src/x-sh.c
@@ -324,7 +324,7 @@ comment_line_end ()
buffer = xrealloc (buffer, bufmax);
}
buffer[buflen] = '\0';
- xgettext_comment_add (buffer);
+ savable_comment_add (buffer);
}
@@ -745,7 +745,7 @@ read_word (struct word *wp, int looking_for, flag_context_ty context)
precede it, with no non-whitespace token on a line between
both. */
if (last_non_comment_line > last_comment_line)
- xgettext_comment_reset ();
+ savable_comment_reset ();
wp->type = t_separator;
return;
}
@@ -1024,8 +1024,10 @@ read_word (struct word *wp, int looking_for, flag_context_ty context)
grow_token (&string);
string.chars[string.charcount++] = (unsigned char) c;
}
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message (mlp, string_of_token (&string),
context, &pos);
+ savable_comment_reset ();
free_token (&string);
error_with_progname = false;
@@ -1165,8 +1167,10 @@ read_command (int looking_for, flag_context_ty outer_context)
pos.file_name = logical_file_name;
pos.line_number = inner.line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message (mlp, string_of_word (&inner),
inner_context, &pos);
+ savable_comment_reset ();
}
}
@@ -1225,8 +1229,10 @@ read_command (int looking_for, flag_context_ty outer_context)
pos.file_name = logical_file_name;
pos.line_number = inner.line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
mp = remember_a_message (mlp, string_of_word (&inner),
inner_context, &pos);
+ savable_comment_reset ();
if (argnum2 > 0)
plural_mp = mp;
}
@@ -1239,8 +1245,10 @@ read_command (int looking_for, flag_context_ty outer_context)
pos.file_name = logical_file_name;
pos.line_number = inner.line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message_plural (plural_mp, string_of_word (&inner),
inner_context, &pos);
+ savable_comment_reset ();
}
}
diff --git a/gettext-tools/src/x-smalltalk.c b/gettext-tools/src/x-smalltalk.c
index 46faa00..76383a5 100644
--- a/gettext-tools/src/x-smalltalk.c
+++ b/gettext-tools/src/x-smalltalk.c
@@ -1,5 +1,5 @@
/* xgettext Smalltalk backend.
- Copyright (C) 2002-2003 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc.
This file was written by Bruno Haible <haible@clisp.cons.org>, 2002.
@@ -148,7 +148,7 @@ comment_line_end ()
buffer = xrealloc (buffer, bufmax);
}
buffer[buflen] = '\0';
- xgettext_comment_add (buffer);
+ savable_comment_add (buffer);
}
@@ -242,7 +242,7 @@ phase2_get (token_ty *tp)
case '\n':
if (last_non_comment_line > last_comment_line)
- xgettext_comment_reset ();
+ savable_comment_reset ();
/* FALLTHROUGH */
case ' ':
case '\t':
@@ -541,7 +541,9 @@ extract_smalltalk (FILE *f,
lex_pos_ty pos;
pos.file_name = logical_file_name;
pos.line_number = token.line_number;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message (mlp, token.string, null_context, &pos);
+ savable_comment_reset ();
state = 0;
break;
}
@@ -550,8 +552,10 @@ extract_smalltalk (FILE *f,
lex_pos_ty pos;
pos.file_name = logical_file_name;
pos.line_number = token.line_number;
+ savable_comment_to_xgettext_comment (savable_comment);
plural_mp = remember_a_message (mlp, token.string,
null_context, &pos);
+ savable_comment_reset ();
state = 4;
break;
}
@@ -560,8 +564,10 @@ extract_smalltalk (FILE *f,
lex_pos_ty pos;
pos.file_name = logical_file_name;
pos.line_number = token.line_number;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message_plural (plural_mp, token.string,
null_context, &pos);
+ savable_comment_reset ();
state = 0;
break;
}
diff --git a/gettext-tools/src/x-tcl.c b/gettext-tools/src/x-tcl.c
index eae7cf6..ace1372 100644
--- a/gettext-tools/src/x-tcl.c
+++ b/gettext-tools/src/x-tcl.c
@@ -393,7 +393,7 @@ comment_line_end ()
buffer = xrealloc (buffer, bufmax);
}
buffer[buflen] = '\0';
- xgettext_comment_add (buffer);
+ savable_comment_add (buffer);
}
@@ -740,7 +740,7 @@ read_word (struct word *wp, int looking_for, flag_context_ty context)
/* Comments assumed to be grouped with a message must immediately
precede it, with no non-whitespace token on a line between both. */
if (last_non_comment_line > last_comment_line)
- xgettext_comment_reset ();
+ savable_comment_reset ();
wp->type = t_separator;
return;
}
@@ -885,8 +885,10 @@ read_command (int looking_for, flag_context_ty outer_context)
pos.file_name = logical_file_name;
pos.line_number = inner.line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message (mlp, string_of_word (&inner),
inner_context, &pos);
+ savable_comment_reset ();
}
}
@@ -938,8 +940,10 @@ read_command (int looking_for, flag_context_ty outer_context)
pos.file_name = logical_file_name;
pos.line_number = inner.line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
mp = remember_a_message (mlp, string_of_word (&inner),
inner_context, &pos);
+ savable_comment_reset ();
if (argnum2 > 0)
plural_mp = mp;
}
@@ -952,8 +956,10 @@ read_command (int looking_for, flag_context_ty outer_context)
pos.file_name = logical_file_name;
pos.line_number = inner.line_number_at_start;
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message_plural (plural_mp, string_of_word (&inner),
inner_context, &pos);
+ savable_comment_reset ();
}
}
}
diff --git a/gettext-tools/src/x-ycp.c b/gettext-tools/src/x-ycp.c
index 7e8a178..b706b44 100644
--- a/gettext-tools/src/x-ycp.c
+++ b/gettext-tools/src/x-ycp.c
@@ -1,5 +1,5 @@
/* xgettext YCP backend.
- Copyright (C) 2001-2003 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc.
This file was written by Bruno Haible <haible@clisp.cons.org>, 2001.
@@ -179,7 +179,7 @@ phase2_getc ()
buffer = xrealloc (buffer, bufmax);
}
buffer[buflen] = '\0';
- xgettext_comment_add (buffer);
+ savable_comment_add (buffer);
last_comment_line = lineno;
return '\n';
}
@@ -225,7 +225,7 @@ phase2_getc ()
|| buffer[buflen - 1] == '\t'))
--buflen;
buffer[buflen] = '\0';
- xgettext_comment_add (buffer);
+ savable_comment_add (buffer);
buflen = 0;
lineno = line_number;
last_was_star = false;
@@ -244,7 +244,7 @@ phase2_getc ()
|| buffer[buflen - 1] == '\t'))
--buflen;
buffer[buflen] = '\0';
- xgettext_comment_add (buffer);
+ savable_comment_add (buffer);
break;
}
/* FALLTHROUGH */
@@ -284,7 +284,7 @@ phase2_getc ()
buffer = xrealloc (buffer, bufmax);
}
buffer[buflen] = '\0';
- xgettext_comment_add (buffer);
+ savable_comment_add (buffer);
last_comment_line = lineno;
return '\n';
}
@@ -426,7 +426,7 @@ x_ycp_lex (token_ty *tp)
case '\n':
if (last_non_comment_line > last_comment_line)
- xgettext_comment_reset ();
+ savable_comment_reset ();
/* FALLTHROUGH */
case '\r':
case '\t':
@@ -616,15 +616,19 @@ extract_parenthesized (message_list_ty *mlp,
if (plural_mp == NULL)
{
/* Seen an msgid. */
+ savable_comment_to_xgettext_comment (savable_comment);
plural_mp = remember_a_message (mlp, token.string,
inner_context, &pos);
+ savable_comment_reset ();
state = 2;
}
else
{
/* Seen an msgid_plural. */
+ savable_comment_to_xgettext_comment (savable_comment);
remember_a_message_plural (plural_mp, token.string,
inner_context, &pos);
+ savable_comment_reset ();
state = 0;
}
}