refactor: integrate compilation-owned identifier interning
This commit is contained in:
@@ -4,13 +4,11 @@ import "@std/hashmap"
|
||||
|
||||
InternError :: enum { out_of_space }
|
||||
|
||||
#! identifies a string only within its owning pool.
|
||||
StringId :: alias u32
|
||||
|
||||
no_str :: maxval!(StringId)
|
||||
|
||||
#! global pool owned by main.hon; initialize before scanning and release with deinit.
|
||||
strings StringPool := undefined
|
||||
|
||||
#! retains its allocator and owns interned copies; release all storage with deinit.
|
||||
StringPool :: struct {
|
||||
ids hashmap.StringHashMap(StringId) # string → id
|
||||
|
||||
Reference in New Issue
Block a user