I’m not sure about editing the cases or adding new ones, since the “typo” in each of those cases appears after the first error, so it doesn’t really affect anything.
You’ll get puzzle editing rights once you reach level 29, which should be very soon!
As 5DN1L said it is intentional design, it shouldn’t have mattered for two reasons 1) I had emphasized on the need to reference variables when passing it to a logical instruction (even though I didn’t apply it to my code for some reason) 2) the interpreter would stop on the first error.
That being said, I added the idea to its testcase, thanks.
In all available tests, the variable references use dollars, hence my code for parsing “values” was the following:
def parse_value(token_iter: Iterable[Token]) -> str | int:
"""Parse a value."""
typ, value = next(token_iter)
match typ:
case "number":
return value
case "dollar_name":
return value
raise NotImplementedError()
This passed all tests but not validators, so for anyone who doesn’t know you can check the validators (in good faith) in the contributions, it can be pretty frustrating ^^
I’ve just tested the above code with the revised tests and the “Error if statement” test indeed fail in this case, so everything is correct now. Thanks a lot!