3 ms·
> In case of a parse error, you may not be able to recover correctly the parsing of any code beyond the error. Of course, ambiguous syntax will obscure any inf
by zdragnar 5y ago
> In case of a parse error, you may not be able to recover correctly the parsing of any code beyond the error.
Of course, ambiguous syntax will obscure any information beyond what can be understood (short of having a compiler track changes between runs).
Some languages / compilers can recover after a parse error. Going back to the ts language server, if you introduce a single quote, unclosed, nothing works until the end of the line (single quoted strings cannot be multiline)
Both before the quote and after that line, however, features such as auto-importing and autocompletion still work as expected.
This is an issue of where the boundaries of the ambiguity lie (what is possible) and the implementation (what actually happens). I suspect many language / compiler / IDE tools fall in different places on the spectrum of possible and works to possible but not implemented. My hunch is that more and more, tools are getting closer to the "possible and works" side of things.