Open ZeWaka opened 5 years ago
@ZeWaka Can you give a minimal example of code that triggers this? I can't replicate the error
I'm guessing something like
var/list/L = list("1", "0", "0", "1", "1", "0", "1")
for("1" in L)
//runs 4 times
@Cyberboss doesn't compile in DM, so I'm not sure where you are going with it
I'm noting this because it's related, but I don't want it "fixed". Found on Polaris, considered dead code and eliminated by DreamMaker, and thus nonsense that SpacemanDMM should error on.
for(1 to rand(1, 3))
laws.add_ion_law(generate_ion_law(exclude_crew_names = TRUE))
/mob
var/foo
var/list/L = list()
/mob/proc/foo()
for(src.foo in src.L)
world.log << foo
@SpaceManiac is that for(1 to X)
issue a separate issue orrrr?
for(1 to X)
is nonsense and should error, it doesn't really matter how
The feature request in this ticket is that for(multipronged.lvalue.expression in L)
should parse
Error:
for-list must start with variable
It doesn't need to in the case of
for (thing1 in thinglist)
It'll just iterate how many times thing1 is in thinglist.
https://github.com/SpaceManiac/SpacemanDMM/blob/7baf6dea13c2f58cbc0faeb250b586e30e355b55/src/dreammaker/parser.rs#L1134