-\f
-/* Comparing identifiers. */
-
-/* Keywords match if one of the following is true: KW and TOK are
- identical (barring differences in case), or TOK is at least 3
- characters long and those characters are identical to KW. KW_LEN
- is the length of KW, TOK_LEN is the length of TOK. */
-int
-lex_id_match_len (const char *kw, size_t kw_len,
- const char *tok, size_t tok_len)
-{
- size_t i = 0;
-
- assert (kw && tok);
- for (;;)
- {
- if (i == kw_len && i == tok_len)
- return 1;
- else if (i == tok_len)
- return i >= 3;
- else if (i == kw_len)
- return 0;
- else if (toupper ((unsigned char) kw[i])
- != toupper ((unsigned char) tok[i]))
- return 0;
-
- i++;
- }
-}
-
-/* Same as lex_id_match_len() minus the need to pass in the lengths. */
-int
-lex_id_match (const char *kw, const char *tok)
-{
- return lex_id_match_len (kw, strlen (kw), tok, strlen (tok));
-}
-\f