3 releases (breaking)

0.20.0 Sep 15, 2022
0.19.1 Mar 19, 2022
0.16.1 Oct 28, 2020

#44 in Text editors

Download history 1355/week @ 2023-02-11 1982/week @ 2023-02-18 1911/week @ 2023-02-25 2159/week @ 2023-03-04 1970/week @ 2023-03-11 2126/week @ 2023-03-18 1087/week @ 2023-03-25 590/week @ 2023-04-01 576/week @ 2023-04-08 503/week @ 2023-04-15 793/week @ 2023-04-22 896/week @ 2023-04-29 853/week @ 2023-05-06 998/week @ 2023-05-13 1126/week @ 2023-05-20 1031/week @ 2023-05-27

4,130 downloads per month
Used in 2 crates

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

~1.4–2MB
~53K SLoC