OpenDream
OpenDream copied to clipboard
Fold constant AST expressions into strings instead of interpolating them
This is technically not something BYOND is great at doing.
It means things like set name = "FOO ([STRING_DEFINE])"
will no longer error, which is good; they work fine in BYOND, I'm pretty sure.
However, it also means that var/const/foo = "FOO ([STRING_DEFINE])"
will work, which technically breaks parity with BYOND, but only in that it's more permissive.
Acceptable parity break IMO
We're going to "parity break" a lot with having better constant-folding than BYOND. None of that will ever negatively affect the behaviour of any targetted codebase, though. It just means better performance at runtime. Don't worry about it!
Should this fix #700?
Should this fix #700?
No.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Turns out the name thing doesn't actually work and both are bugged in BYOND. Still, acceptable parity break etc.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
I'm not a fan of this method of constant-folding string interpolations. The AST should strive to stay as true to the source as it can, and something like this would be better done in the string's DMExpression.
I'm going to close this since it's getting rather stale and I'd prefer this be re-done in another PR.