diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-03 16:15:27 +0100 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-03 16:15:27 +0100 |
| commit | 710197797f399a17fc3bcabe2d3816e728487571 (patch) | |
| tree | 1f27be9e39a8cb07765e74a9f3a3d3810a324019 /src/utf8.cc | |
| parent | 448b3baa76b6bd25e972e1134941cb649b6a91d0 (diff) | |
working on identifiers
Diffstat (limited to 'src/utf8.cc')
| -rw-r--r-- | src/utf8.cc | 12 |
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 |
