Go bindings for tree-sitter ruby on top of go-tree-sitter.
$ go get github.com/shagabutdinov/go-tree-sitter-ruby
$ cd $GOPATH/src/github.com/shagabutdinov/go-tree-sitter-ruby
$ ./scripts/build.sh
# build may take a significant time because ruby grammar has
# 800+k lines of C code
package main
import (
"github.com/shagabutdinov/go-tree-sitter-ruby"
"github.com/smacker/go-tree-sitter"
"log"
)
func main() {
parser := sitter.NewParser()
parser.SetLanguage(ruby.GetLanguage())
sourceCode := []byte("variable = 'value'")
tree := parser.Parse(sourceCode)
defer tree.Delete()
log.Println(tree.RootNode().String())
}