+2001-12-03 Tommy Johansson <tommy.johansson@kanalen.org>
+
+ * x-java.l (tailcmp): New function.
+ (do_compare): Use it instead of strcmp.
+ (extract_java): After seeing an invocation, don't set the state to
+ STATE_NONE.
+
2001-11-30 Bruno Haible <bruno@clisp.org>
* message.c (message_merge): Determine whether postprocessing is
static inline bool isplus PARAMS ((char *s));
static inline bool isdot PARAMS ((char *s));
static char *translate_esc PARAMS ((char *s));
+static bool tailcmp PARAMS ((const char *s1, const char *s2));
static bool do_compare PARAMS ((const char *s1, const char *s2));
static java_keyword *is_keyword PARAMS ((const char *s));
static void free_global PARAMS ((void));
}
+/**
+ * Backwards substring match.
+ */
+static bool
+tailcmp (s1, s2)
+ const char *s1;
+ const char *s2;
+{
+ int len1 = strlen (s1);
+ int len2 = strlen (s2);
+ int start = len1 - len2;
+ if (start < 0)
+ return false;
+ return strcmp (s1 + start, s2) == 0;
+}
+
/**
* Try to match a string against the keyword. If substring_match is
* true substring match is used.
if (substring_match)
return strstr (s1, s2) != NULL;
else
- return strcmp (s1, s2) == 0;
+ return tailcmp (s1, s2);
}
/**
if (java_keywords == NULL)
{
/* ops, no standard keywords */
- x_java_keyword ("gettext"); /* GettextResource.gettext */
- x_java_keyword ("ngettext:1,2"); /* GettextResource.ngettext */
+ x_java_keyword ("GettextResource.gettext:2"); /* static method */
+ x_java_keyword ("GettextResource.ngettext:2,3"); /* static method */
+ x_java_keyword ("gettext");
+ x_java_keyword ("ngettext:1,2");
x_java_keyword ("getString"); /* ResourceBundle.getString */
}
k2 = append_strings (key, ".");
free (key);
key = append_strings (k2, parser_global->word);
- state = STATE_NONE;
}
else
{