1 unstable release

0.20.0 Sep 5, 2022

#343 in Text editors

Download history 466/week @ 2023-11-20 576/week @ 2023-11-27 481/week @ 2023-12-04 803/week @ 2023-12-11 539/week @ 2023-12-18 510/week @ 2023-12-25 509/week @ 2024-01-01 523/week @ 2024-01-08 464/week @ 2024-01-15 421/week @ 2024-01-22 703/week @ 2024-01-29 485/week @ 2024-02-05 568/week @ 2024-02-12 770/week @ 2024-02-19 477/week @ 2024-02-26 470/week @ 2024-03-04

2,361 downloads per month
Used in ast-grep-language

MIT license

22MB
670K SLoC

C 669K SLoC // 0.0% comments JavaScript 1.5K SLoC // 0.0% comments Scheme 225 SLoC // 0.1% comments Rust 35 SLoC // 0.1% comments

tree-sitter-c-sharp

This crate provides a C# 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-c-sharp = "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#"
    class Test {
        int double(int x) => x * 2;
    }
"#;
let mut parser = Parser::new();
parser.set_language(tree_sitter_c_sharp::language()).expect("Error loading C# 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