This follows on from #621.
At the moment, there are a large number of syntax checks in CodeGenerator. For example, it reports whether a variable is possibly uninitialised, whether or not a break statement is enclosing a loop, etc. These checks should not be in CodeGenerator and are making it more complex than necessary. They should be moved either into the parser, or elsewhere. In some cases, they may even be redundant.
Ok, I've done what I can here. But, it's not finished yet. In particular, see #628