Re:Automatic Syntax Error Recovery
by loopz on Wednesday November 18, 2020 @11:12PM
(#25146159)
I'd much rather have a helpful compiler error than run something that has been "repaired" and may silently do the wrong thing.
[ Parent
| on HN ]
Re:Automatic Syntax Error Recovery
by thehobgoblin on Thursday November 19, 2020 @01:20AM
(#25146777)
You wouldn't be running anything that has been repaired, the fact that a repair is done means that a syntax error has occurred and compilation has failed. The repair is just a recovery strategy so that the compiler can work further in order to potentially uncover further errors.
This is what compilers do already, one such strategy is to unwind the state to before the error and skip over the erroneous part. This can be a bit problematic in certain situations, such as a syntax error in a variable definition and the following flood of 'undefined variable' errors.
The repair strategy in the article is trying to optimise the quality of the attempted repair in order to provide better error messages to the user.