Use ms table for remaining UCD lookups

This commit is contained in:
Kovid Goyal
2025-03-25 15:41:34 +05:30
parent aad58cf703
commit 294de16898
10 changed files with 328 additions and 2266 deletions

View File

@@ -1,14 +1,11 @@
#pragma once
#include "data-types.h"
#include "state.h"
#include "char-props.h"
// Converts row/column diacritics to numbers.
int diacritic_to_num(char_type ch);
bool is_word_char(char_type ch);
bool is_CZ_category(char_type);
bool is_P_category(char_type);
static inline bool
is_excluded_from_url(uint32_t ch) {
if (OPT(url_excluded_characters)) {
@@ -61,15 +58,9 @@ is_url_char(uint32_t ch) {
static inline bool
can_strip_from_end_of_url(uint32_t ch) {
// remove trailing punctuation
return (is_P_category(ch) && ch != '/' && ch != '&' && ch != '-' && ch != ')' && ch != ']' && ch != '}');
return (char_props_for(ch).is_punctuation && ch != '/' && ch != '&' && ch != '-' && ch != ')' && ch != ']' && ch != '}');
}
static inline bool
is_private_use(char_type ch) {
return (0xe000 <= ch && ch <= 0xf8ff) || (0xF0000 <= ch && ch <= 0xFFFFF) || (0x100000 <= ch && ch <= 0x10FFFF);
}
static inline bool
is_flag_codepoint(char_type ch) {
return 0x1F1E6 <= ch && ch <= 0x1F1FF;