Tweak categorize(Codepoint) implementation
This commit is contained in:
parent
b5a68307ba
commit
15e82518d3
|
@ -58,14 +58,13 @@ enum class CharCategories
|
||||||
template<WordType word_type = Word>
|
template<WordType word_type = Word>
|
||||||
inline CharCategories categorize(Codepoint c)
|
inline CharCategories categorize(Codepoint c)
|
||||||
{
|
{
|
||||||
if (is_word(c))
|
|
||||||
return CharCategories::Word;
|
|
||||||
if (is_eol(c))
|
if (is_eol(c))
|
||||||
return CharCategories::EndOfLine;
|
return CharCategories::EndOfLine;
|
||||||
if (is_horizontal_blank(c))
|
if (is_horizontal_blank(c))
|
||||||
return CharCategories::Blank;
|
return CharCategories::Blank;
|
||||||
return word_type == WORD ? CharCategories::Word
|
if (word_type == WORD or is_word(c))
|
||||||
: CharCategories::Punctuation;
|
return CharCategories::Word;
|
||||||
|
return CharCategories::Punctuation;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Codepoint to_lower(Codepoint cp) { return towlower((wchar_t)cp); }
|
inline Codepoint to_lower(Codepoint cp) { return towlower((wchar_t)cp); }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user