Re:Learn Python ASTs, by building your own linter
by tusharsadhwani on Wednesday December 29, 2021 @09:29AM
(#29725073)
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.
Existing code editors like VSCode do exactly this for better syntax highlighting of incomplete code.