summaryrefslogtreecommitdiff
path: root/src/utf8.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/utf8.cc')
-rw-r--r--src/utf8.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/utf8.cc b/src/utf8.cc
index 255508e..e2da09d 100644
--- a/src/utf8.cc
+++ b/src/utf8.cc
@@ -22,4 +22,16 @@ inline u8 utf8_nobytes(unsigned char c) {
panic("what even is: %d\n", c);
}
+inline bool utf8_is_identifier(wchar c) {
+ return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
+}
+
+inline bool utf8_is_number(wchar c) {
+ return ('0' <= c && c <= '9');
+}
+
+inline bool utf8_is_alnum(wchar c) {
+ return utf8_is_identifier(c) || utf8_is_number(c);
+}
+
#endif