- Use tree-sitter v0.24.3.
- Use tree-sitter v0.23.0.
- Cross-compilation is now working for most targets:
aarch64-linux-gnu
aarch64-linux-musl
arm-linux-gnu
arm-linux-musl
x86_64-linux-gnu
x86_64-linux-musl
x86-linux-musl
arm64-darwin
x86_64-darwin
We now produce fat native gems so you don't have to install tree-sitter on your machine, and not even compile it if you don't need to.
- Language loading, e.g.
TreeSitter.lang
, is now case insensitive for path lookup only: loadingTreeStand.lang('COBOL')
will look for the correctCOBOL
symbol in the parser, wheter it's stored incobol.so
,COBOL.so
, etc. - Fixed a bug that caused an exception when reporting an exception in language loading.
- Cross-compilation support is dropped because it doesn't work with
--disable-sys-lib
. We need a better understanding of rake-compiler-dock and rake-compiler. v1.4.2 is especially broken. Skip all v1.4.
- Remove sorbet's
T.unsafe
. This preventedTreeSitter.language
to function outside ofTreeStand
.
v1.4.0 had issues publishing to rubygems.org.
This version is identical to the previous one.
TreeSitter::Node
is enumerable.TreeSitter::{QueryCaptures, QueryMatches}
are enumerable.TreeStand::Node
now supports query predicates fromTreeSitter
.TreeSitter::QueryMatches
now has aeach_capture_hash
method returning anEnumerator<Hash<String, Node>>
, the rough equivalent of whatTreeStand::Node#query
returns.- TreeSitter and TreeStand now share the same parser (
dylib
orso
) loading mechanism:TreeSitter.language('language')
orTreeSitter.lang('language')
TreeStand::Parser.new('language')
- Query Predicates landed. See https://tree-sitter.github.io/tree-sitter/using-parsers#predicates.
Node#field?
accepts symbols and strings.Node#child_by_filed_name
- no longer SEGFAULTs when the field name does not exist, returning
nil
instead. - accepts symbols and strings.
- no longer SEGFAULTs when the field name does not exist, returning
fetch
isfetch_all
now, andfetch_all
is removed. The API was confusing at best.
Parser.language
- Automatic loading of parsers if installed on the system, or in a local
tree-sitter-parsers
directory. - Handle mac and linux (dylib and so).
- Automatic loading of parsers if installed on the system, or in a local
- Expose more thing from
TreeSitter::Node
toTreeStand::Node
, notably:# TreeStand TreeSitter [] [] fetch fetch field child_by_field_name fields each_field named each_named next next_sibling prev prev_sibling next_named next_named_sibling prev_named prev_named_sibling field_names fields
Node#text
now correctly fetches the text according to byte ranges.
- Support for v0.20.9.
- Support for v0.20.9.
- Integration of the TreeStand gem https://github.com/Shopify/tree_stand/.
- Derek Stride joins as maintainer.
- When you use
--disable-sys-lib
this extension will: - download
tree-sitter
viagit
,curl
, orwget
. - statically link against downloaded
tree-sitter
. - The native gems are also statically linked.
With static linking, any installed version of tree-sitter
will not be loaded.
All other methods will dynamically link against the installed tree-sitter
.