I feel like I must be missing something. I’ve completed everything for the interpreter all the way up to the syntax error tests at the end of the control flow extension. The tests keep failing because they time out, which makes sense, because this is the test case it fails on:
for (;;) var foo;
As far as I can tell, this is valid Lox according to chapter 9.5:
forStmt → "for" "(" ( varDecl | exprStmt | ";" ) expression? ";" expression? ")" statement ;
The chapter even explicitly says all the clauses can be omitted, and var foo;
is (edit: not) a valid statement, so I’m not really sure what I’m supposed to do here.
edit: I’ve just realised my problem, I deviated slightly from the book a few chapters ago and ended up with declarations being at the same level as statements, which they shouldn’t be. Should’ve known better than to go off the beaten path.