style: use snake_case for constants

This commit is contained in:
2026-10-08 21:04:44 +02:00
parent 57e544f255
commit cb3f187b54
8 changed files with 20 additions and 20 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ InternError :: enum { out_of_space }
StringId :: alias u32
NO_STR :: maxval!(StringId)
no_str :: maxval!(StringId)
#! global pool owned by main.hon; initialize before scanning and release with deinit.
strings StringPool := undefined
@@ -38,7 +38,7 @@ deinit proc(pool @mut StringPool) void {
intern proc(pool @mut StringPool, str []u8) StringId ! (mem.AllocError | InternError) {
if hashmap.get(&pool.ids, str) |id| return id
if (pool.strings.items.len >= usize(NO_STR)) return .out_of_space
if (pool.strings.items.len >= usize(no_str)) return .out_of_space
id :: StringId(pool.strings.items.len)
owned_str []mut u8 :: try mem.alloc(u8, pool.allocator, str.len)