diff options
Diffstat (limited to 'lib/unicode/prop/uprop_is_pat_ws.c')
-rw-r--r-- | lib/unicode/prop/uprop_is_pat_ws.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/unicode/prop/uprop_is_pat_ws.c b/lib/unicode/prop/uprop_is_pat_ws.c new file mode 100644 index 0000000..fe2f462 --- /dev/null +++ b/lib/unicode/prop/uprop_is_pat_ws.c @@ -0,0 +1,30 @@ +/* This file is autogenerated by gen/prop/bool-props; DO NOT EDIT. */ + +#include "__bsearch.h" +#include "bitset.h" +#include "rune.h" +#include "unicode/prop.h" + +/* clang-format off */ + +static constexpr bitset(bs, LATIN1_MAX) = { + 0x00, 0x3E, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const struct { + rune lo, hi; +} lookup[] = { + {RUNE_C(0x00200E), RUNE_C(0x00200F)}, + {RUNE_C(0x002028), RUNE_C(0x002029)}, +}; + +__MLIB_DEFINE_BSEARCH_CONTAINS(lookup) + +bool +uprop_is_pat_ws(rune ch) +{ + return ch <= LATIN1_MAX ? TESTBIT(bs, ch) : mlib_lookup_contains(ch); +} |