2 unstable releases

0.17.0 Nov 3, 2020
0.16.2 Oct 27, 2020

#12 in #ruby

Download history 68/week @ 2021-01-15 5/week @ 2021-01-22 58/week @ 2021-02-05 24/week @ 2021-02-12 48/week @ 2021-02-19 54/week @ 2021-02-26 46/week @ 2021-03-05 14/week @ 2021-03-12 15/week @ 2021-03-19 14/week @ 2021-03-26 5/week @ 2021-04-02 1/week @ 2021-04-09 4/week @ 2021-04-16 3/week @ 2021-04-23 44/week @ 2021-04-30

136 downloads per month

MIT license

9MB
284K SLoC

C 283K SLoC C++ 889 SLoC // 0.0% comments JavaScript 848 SLoC // 0.0% comments Scheme 190 SLoC // 0.1% comments Rust 43 SLoC // 0.1% comments

tree-sitter-ruby

This crate provides a Ruby grammar for the tree-sitter parsing library. To use this crate, add it to the [dependencies] section of your Cargo.toml file. (Note that you will probably also need to depend on the tree-sitter crate to use the parsed result in any useful way.)

[dependencies]
tree-sitter = "0.17"
tree-sitter-ruby = "0.16"

Typically, you will use the language function to add this grammar to a tree-sitter Parser, and then use the parser to parse some code:

let code = r#"
    def double(x)
      x * 2
    end
"#;
let mut parser = Parser::new();
parser.set_language(tree_sitter_ruby::language()).expect("Error loading Ruby grammar");
let parsed = parser.parse(code, None);

If you have any questions, please reach out to us in the tree-sitter discussions page.

Dependencies

~1.4–2MB
~52K SLoC