summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-23 13:07:37 -0500
committerpommicket <pommicket@gmail.com>2022-12-23 13:07:37 -0500
commit7bf8860601771be812e72c557fe9681c968bceaf (patch)
tree035f7a767628daf8cdda1160555f39a8cfc698b7 /util.c
parente4774c14963bf51840bbf940c1181fe7fc7c3046 (diff)
identifier-trigger-characters setting
Diffstat (limited to 'util.c')
-rw-r--r--util.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/util.c b/util.c
index e973674..32115cf 100644
--- a/util.c
+++ b/util.c
@@ -7,6 +7,21 @@
#error "Unrecognized operating system."
#endif
+
+// Is this character a "word" character?
+static bool is_word(char32_t c) {
+ return c > WCHAR_MAX || c == '_' || iswalnum((wint_t)c);
+}
+
+static bool is_digit(char32_t c) {
+ return c < WCHAR_MAX && iswdigit((wint_t)c);
+}
+
+static bool is_space(char32_t c) {
+ return c < WCHAR_MAX && iswspace((wint_t)c);
+}
+
+
static u8 util_popcount(u64 x) {
#ifdef __GNUC__
return (u8)__builtin_popcountll(x);