1 unstable release

0.20.0 Sep 5, 2022

#499 in Text editors

Download history 112/week @ 2024-07-23 109/week @ 2024-07-30 104/week @ 2024-08-06 101/week @ 2024-08-13 104/week @ 2024-08-20 96/week @ 2024-08-27 101/week @ 2024-09-03 101/week @ 2024-09-10 91/week @ 2024-09-17 110/week @ 2024-09-24 114/week @ 2024-10-01 108/week @ 2024-10-08 70/week @ 2024-10-15 2/week @ 2024-10-29 4/week @ 2024-11-05

97 downloads per month

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.8–4MB
~76K SLoC