We need to allow colorspace setting to make HSV gradients possible,
which is real powerful. It is technically a bit fucked because byond is
ok with passing a value for index after the assoc space value, but we
can just pretend that isn't a problem.
Fixes recent bugs in error message generation.
Removes the need to track whether next() has been called multiple times
in a row for the purpose of ignoring out-of-place doc comments.
515 feature https://www.byond.com/forum/post/2857912
currently,
```dm
#if fexists("secret/secret.dme") // non-constant function call: fexists
#warn wow you have a secret.dme file
#endif
```
can't actually const eval since it can have diff. behavior at runtime obv
---------
Co-authored-by: Tad Hardesty <tad@platymuus.com>
Currently, there is `Map::adjust_key_length()`, but it sets key length
based on the amount of items in the dictionary. Which is fine if keys
in order like 1-2-3-4-...-N, but it falls apart if the keys are not in
order - which is valid for a dmm map.
If a map has keys like [1, 2, 3000], then, currently,
`Map::adjust_key_length()` will set key length to 1, but the map will
panic on save cause the 3000 key is bigger than max key for this key
length (52).
This PR fixes `adjust_key_length` to work properly in that case, where
it sets key length based on the biggest key in the map dictionary.
Also `dmm_tools::dmm::Map::to_writer()`, so it can be used to save to a
string and not just a file, for use in external tooling that depends on
this, and may want to, for example, pass the string back to byond from
rust-g.
`dmm_tools::dmm::Map::to_file()` is kept for convenience (and
backwards compatibility I guess to not break code), but it just uses
the `::to_writer()` function.
A ton of time was spent constructing/destructing the Tera contexts, so
skipping that step by using a compile-time templater helps a lot. Takes
dmdoc time on /tg/station13 down from 10+ minutes to <5 seconds.
Adds support for :: to the parser, in all its forms (global proc/var,
off type). Also implements behavior for it. We'll properly read the
type of what we attach to, and double check that everything matches.
Works for the proc refs too.
I've added unit tests for all this to double check my work. I DIDN'T
mirror the static var detection byond does. problem for another day.
I'm not hooking it into the existing return type system because I'm
pretty sure it doesn't already support primitives, and I am not prepared
to deal with that bullshit.
It will parse without erroring tho, so that's based.