5 questions to test your understanding
A scanner encounters an unterminated string literal: `"hello` at the end of a line with no closing quote. What is the most appropriate panic-mode recovery action?
What is the primary goal of error recovery in a lexical analyzer, as opposed to simply halting on the first error?
A single lexical error in one part of a source file typically makes most tokens after it invalid and unusable by the parser.
A high-quality lexical error message should include the source file name, line number, column position, and a description of what was encountered — so the programmer can locate and understand the problem without re-reading the whole file.
Why is designing good lexical error messages considered a 'user interface problem' rather than just a technical correctness problem?