Add \ref support for strings
Is this related to #700?
no
Spurious CI failure again. I think github is having an issue.
Isn't this going to permanently leak all strings passed through \ref? You may want a different string tree that uses weak references instead, and some sort of cleanup routine.
True but this is still pretty much a placeholder ref implementation anyways to bandaid round init while we work on other things.
Review addressed but I haven't thoroughly tested the changes.
This breaks locate() for DreamObjects currently. locate("10") looks for a DreamObject with ID 10 instead of 0.
Ready for review
Isn't this going to permanently leak all strings passed through
\ref? You may want a different string tree that uses weak references instead, and some sort of cleanup routine.
Yes, this will allow you to get any string existing at compile time or passed through ref(). This is actually similar behavior to byond, which can be observed with the following code:
for (var/i in 1 to 0x1a0)
world.log << locate("\[0x6000[num2text(i, 3, 16)]\]")
I don't think a cleanup routine would be possible, as there's no way to tell when the code will want to locate() it.