1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Strongly-typed AST types for C#, auto-generated from
//! [`tree-sitter-c-sharp`](https://docs.rs/tree-sitter-c-sharp)'s `node-types.json`.
//!
//! This crate is generated by [`treesitter-types`](https://docs.rs/treesitter-types) and is
//! automatically kept up to date when a new version of the grammar crate is released.
//!
//! These types have been tested by parsing the
//! [.NET Runtime](https://github.com/dotnet/runtime) source code.
//!
//! See the [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) project for more
//! information about the underlying parser framework.
//!
//! # Example
//!
//! ```
//! use treesitter_types_c_sharp::*;
//!
//! // A minimal C# hello-world program (without using directives).
//! let src = b"\
//! class Hello {
//! static void Main() {
//! System.Console.WriteLine(\"Hello, World!\");
//! }
//! }
//! ";
//!
//! // Parse the source with tree-sitter and convert into typed AST.
//! let mut parser = tree_sitter::Parser::new();
//! parser.set_language(&tree_sitter_c_sharp::LANGUAGE.into()).unwrap();
//! let tree = parser.parse(src, None).unwrap();
//! let cu = CompilationUnit::from_node(tree.root_node(), src).unwrap();
//!
//! // The compilation unit has one top-level child: the class declaration.
//! assert_eq!(cu.children.len(), 1);
//!
//! let CompilationUnitChildren::TypeDeclaration(type_decl) = &cu.children[0] else {
//! panic!("expected a type declaration");
//! };
//! let TypeDeclaration::ClassDeclaration(class) = type_decl.as_ref() else {
//! panic!("expected a class declaration");
//! };
//! assert_eq!(class.name.text(), "Hello");
//!
//! // The class body contains one method.
//! assert_eq!(class.body.as_ref().unwrap().children.len(), 1);
//! ```
pub use tree_sitter_c_sharp;
pub use tree_sitter;
pub use ;
pub use *;