Hacker News new | ask | show | jobs
by tusharsadhwani 1630 days ago
tree sitter can definitely help with this problem, but so can regular AST parsers, the idea is the same: just add code or grammar that will parse the "invalid" grammar, mark it as invalid, and continue parsing valid code as soon as possible.

Existing code editors like VSCode do exactly this for better syntax highlighting of incomplete code.