[GREENFOOT-363] Give error when user puts semi-colon after if
Some users get the syntax rule wrong (understandably) and write things like this:
{noformat} if (Greenfoot.isKeyDown("left")); { turn(-4); } {noformat}
I've seen this a lot, and it's a bad case, because it's hard to see the problem, and it makes the code look like it has no effect. I propose making this particular construct (single semi-colon as the body of an if) a syntax error in Greenfoot. This means that technically not all valid Java is accepted, but it's such a common case and almost never what the user wants (they can always have empty curly brackets as an empty body instead).
Issue metadata
- Issue type: Task
- Priority: Medium
- Fix versions: 3.0.0