5 releases (3 breaking)

0.20.1 Feb 11, 2024
0.20.0 Nov 1, 2022
0.19.0 Aug 25, 2021
0.17.0 Nov 3, 2020
0.16.2 Oct 27, 2020

#241 in Text editors

Download history 1001/week @ 2023-12-23 1539/week @ 2023-12-30 3082/week @ 2024-01-06 2965/week @ 2024-01-13 4502/week @ 2024-01-20 5454/week @ 2024-01-27 5675/week @ 2024-02-03 7299/week @ 2024-02-10 4426/week @ 2024-02-17 4149/week @ 2024-02-24 3576/week @ 2024-03-02 2676/week @ 2024-03-09 2408/week @ 2024-03-16 2602/week @ 2024-03-23 2296/week @ 2024-03-30 2848/week @ 2024-04-06

10,485 downloads per month
Used in 10 crates (9 directly)

MIT license

15MB
467K SLoC

C 466K SLoC // 0.0% comments JavaScript 1K SLoC // 0.0% comments Scheme 189 SLoC // 0.1% comments Rust 34 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.19"
tree-sitter-ruby = "0.20.1"

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

~2.7–4MB
~71K SLoC