+2002-01-27 Bruno Haible <bruno@clisp.org>
+
+ * x-ycp.c (enum token_type_ty): New enum value token_type_symbol.
+ (x_ycp_lex): Assign a value to tp->string if and only if the type is
+ token_type_string_literal or token_type_symbol.
+ (extract_ycp): Simplify cleanup.
+
2002-01-27 Bruno Haible <bruno@clisp.org>
* x-java.l (extract_java): Don't create a plural message if the
/* xgettext YCP backend.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
This file was written by Bruno Haible <haible@clisp.cons.org>, 2001.
token_type_comma, /* , */
token_type_i18n, /* _( */
token_type_string_literal, /* "abc" */
- token_type_other /* number, symbol, misc. operator */
+ token_type_symbol, /* symbol, number */
+ token_type_other /* misc. operator */
};
typedef enum token_type_ty token_type_ty;
struct token_ty
{
token_type_ty type;
- char *string;
+ char *string; /* for token_type_string_literal, token_type_symbol */
int line_number;
};
int bufpos;
int c;
- tp->string = NULL;
for (;;)
{
tp->line_number = line_number;
}
buffer[bufpos] = '\0';
tp->string = xstrdup (buffer);
- tp->type = token_type_other;
+ tp->type = token_type_symbol;
return;
case '"':
case token_type_eof:
break;
+ case token_type_symbol:
+ free (token.string);
+ /* FALLTHROUGH */
default:
- if (token.string != NULL)
- free (token.string);
state = 0;
continue;
}