> easier to recover from input syntax errors from the Token-based input rather than Unicode-based input
Rust has pretty exact mapping from syntax errors to lexical placement. Couldn't a similar approach be used if you have a potential recovery path?
Rust has pretty exact mapping from syntax errors to lexical placement. Couldn't a similar approach be used if you have a potential recovery path?
During the lexical scanning stage you can persist the token's source code sites, and later reuse them to indicate syntax or similar errors.
For example, in Rust when you parse the syntax from the TokenStream of a procedural macro input, you can bind custom errors to any spans of input tokens, and it works just fine.