Skip to content

v0.26.0

Choose a tag to compare

@github-actions github-actions released this 20 Nov 05:01
· 28 commits to master since this release

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 => x or v in [x], x +1 is x + 1. Pins, constants and k: v keys 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 %w after a reused node, rescue or ; on the line after key:, 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.c 19.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 _arg instead 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.