$ tree-sitter parse -- '/home/wilfred/.emacs.d/**/*.el' --quiet --stat
Total parses: 2272; successful parses: 2271; failed parses: 1; success percentage: 99.96%
It's super easy to test a tree-sitter parser against a large corpus, and to iron out the details!
miniblog.
Related Posts
Test code is total: we require it to always terminate or it's a failure! It also typically has 100% line and branch coverage.
I feel way less nervous about refactoring tests, you can always just run them.
A pleasant surprise: updating the direct dependencies in difftastic has reduced the total transitive dependencies. I wasn't expecting that.
Counter-intuitively, if you're writing a parser for a programming language, you need it to be a total function. As soon as you build IDE tooling, you need ASTs from invalid or incomplete input.
The parser should return (Ast, List<Error>) rather than Result<Ast, Error>.