aboutsummaryrefslogtreecommitdiff
path: root/lib/unicode/prop/uprop_is_pat_syn.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/unicode/prop/uprop_is_pat_syn.c')
-rw-r--r--lib/unicode/prop/uprop_is_pat_syn.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/unicode/prop/uprop_is_pat_syn.c b/lib/unicode/prop/uprop_is_pat_syn.c
new file mode 100644
index 0000000..cab14e8
--- /dev/null
+++ b/lib/unicode/prop/uprop_is_pat_syn.c
@@ -0,0 +1,41 @@
+/* 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, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x00, 0xFC,
+ 0x01, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x78,
+ 0x00, 0x00, 0x00, 0x00, 0xFE, 0x5A, 0x43, 0x88,
+ 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00,
+};
+
+static const struct {
+ rune lo, hi;
+} lookup[] = {
+ {RUNE_C(0x002010), RUNE_C(0x002027)},
+ {RUNE_C(0x002030), RUNE_C(0x00203E)},
+ {RUNE_C(0x002041), RUNE_C(0x002053)},
+ {RUNE_C(0x002055), RUNE_C(0x00205E)},
+ {RUNE_C(0x002190), RUNE_C(0x00245F)},
+ {RUNE_C(0x002500), RUNE_C(0x002775)},
+ {RUNE_C(0x002794), RUNE_C(0x002BFF)},
+ {RUNE_C(0x002E00), RUNE_C(0x002E7F)},
+ {RUNE_C(0x003001), RUNE_C(0x003003)},
+ {RUNE_C(0x003008), RUNE_C(0x003020)},
+ {RUNE_C(0x003030), RUNE_C(0x003030)},
+ {RUNE_C(0x00FD3E), RUNE_C(0x00FD3F)},
+ {RUNE_C(0x00FE45), RUNE_C(0x00FE46)},
+};
+
+__MLIB_DEFINE_BSEARCH_CONTAINS(lookup)
+
+bool
+uprop_is_pat_syn(rune ch)
+{
+ return ch <= LATIN1_MAX ? TESTBIT(bs, ch) : mlib_lookup_contains(ch);
+}