I think this is the main issue. Compilers have always been trying to do some kind of syntax error recovery, to be able to spot more than one syntax error at a time. However, these heuristics are unfortunately fragile. It often ends up with cascading syntax errors where you're better off ignoring the errors after the first one. Not to mention that many error recovery heuristics tend to skip over some statements, which means they can't be used to "autocorrect" the program.
A while back I looked at how several languages implement this and Pascal was actually one of the better ones. It is a very hard problem...
A while back I looked at how several languages implement this and Pascal was actually one of the better ones. It is a very hard problem...