+2001-09-21 Tommy Johansson <tommy.johansson@kanalen.org>
+
+ * x-java.l (create_char_buf): Fix problem with empty messages.
+ (//): Remove leading "//" from result.
+ (x_java_keyword): Handle NULL argument.
+
2001-09-19 Tommy Johansson <tommy.johansson@kanalen.org>
* x-java.l (is_keyword): Swap arguments of do_compare.
{
char_buf *b = (char_buf *) xmalloc (sizeof (char_buf));
b->data = (char *) xmalloc (INITIAL_CHARBUF_SIZE);
+ b->data[0] = '\0';
b->len = 0;
b->maxlen = INITIAL_CHARBUF_SIZE;
return b;
"#"|"@"|"\r"|"`" /* ignore whitespace */
"//"[^\n]* {
- parser_global->comment = xstrdup (yytext);
+ parser_global->comment = xstrdup (yytext + 2);
return JAVA_COMMENT;
}
"\n"|"\r"|"\r\n" parser_global->line_no++;
x_java_keyword (keyword)
const char *keyword;
{
+ if (keyword == NULL) {
+ if (java_keywords != NULL) {
+ string_list_destroy (java_keywords);
+ java_keywords = NULL;
+ }
+ return;
+ }
+
if (java_keywords == NULL)
java_keywords = string_list_alloc ();