switch() allows certain invalid syntax to compile, but not run correctly.
Code Snippet (if applicable) to Reproduce Problem:
proc
popid2num(str)
var/digits = length(str), pos = 1, id
. = 0
for(var/n in digits to 1 step -1)
switch((id = text2ascii(str,pos++)))
if(97)
continue
if(65 to 90)
id = 26 + id-65
if(98 to 122)
id = id - 97
else
throw EXCEPTION("Invalid pop id: [str]")
. += id * 52 ** (n - 1)
Expected Results:
I'd very much expect this to throw a compiler error
Actual Results:
It compiles. I'm not at all sure to what, but it's not right.
https://file.house/Z-TZ.png