Repository navigation
v0.26.0
Maintained fork of tree-sitter-ruby. Changes since 0.25.0:
Parsing
- Names bound by pattern matching are local variables, as in Ruby: after
in [x],in {name:},in A => x,v => xorv in [x],x +1isx + 1. Pins, constants andk: vkeys bind nothing. String keys (in {"name":}) are not handled yet. - An incremental reparse gives the same tree as a fresh parse in 6 more cases, found by a new edit fuzzer:
<<and%wafter a reused node,rescueor;on the line afterkey:,def x = v in [d], and a literal left open. A literal left open is now content up to the end of the file ("abc→ a string with a missing quote), as in Prism.
Size and speed
- The parser is 27 % smaller:
parser.c19.9 → 14.6 MB, 7925 → 6123 states, wasm 2.77 → 2.02 MB (the playground loads faster). - About 2 % fewer instructions to parse.
- In
node-types.json, an endless method (def f = …) is now an_arginstead of a_primary, as in Ruby's grammar.
Packages and CI
- On npm (
@magikdidi24/tree-sitter-ruby), crates.io and PyPI (tree-sitter-ruby-magikdidi24), published with trusted publishing (OIDC): no registry token is stored anywhere. - Pull requests fail when the parser runs more than 3 % more instructions (cachegrind).
- Every night: an hour of fuzzing, and the edit fuzzer with ASan and UBSan.
- Scanner coverage by the tests: 95.9 % of lines, 86.4 % of branches (badge in the README).
NOTE: Download tree-sitter-ruby.tar.gz for the complete source code.