3 releases (breaking)

0.19.0 Aug 25, 2021
0.17.0 Nov 3, 2020
0.16.2 Oct 27, 2020

#163 in Parser tooling

Download history 24/week @ 2021-05-29 3/week @ 2021-06-05 1/week @ 2021-06-12 2/week @ 2021-06-19 10/week @ 2021-06-26 2/week @ 2021-07-03 32/week @ 2021-07-10 87/week @ 2021-07-17 11/week @ 2021-07-24 9/week @ 2021-07-31 5/week @ 2021-08-14 34/week @ 2021-08-21 939/week @ 2021-08-28 1507/week @ 2021-09-04 1690/week @ 2021-09-11

63 downloads per month

MIT license

7.5MB
240K SLoC

C 238K SLoC C++ 1K SLoC // 0.0% comments JavaScript 875 SLoC // 0.0% comments Scheme 183 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