Closed Ratstail91 closed 1 month ago
An alternative would be to store a string's hash.
I'll make a separate "string type" for identifiers that doesn't play well with the normal types, and can't be inserted into trees.
d62ee2a9a37ba16d64ebeb743ea38cadbd61c571
Added name type.
https://github.com/Ratstail91/Toy/blob/71c065a6c4dd7356823457db44186021aed10a95/source/toy_string.h#L15
If I changed this padding to
Toy_ValueType
, I could use it as the type of variable identifiers. It's not the prettiest solution, but the alternatives include copy/pasted code, or obtuse abstract hashtables.I could even add a new string type,
TOY_STRING_IDENTIFIER
, which would block any attempts to fiddle with it like a normal string.