| Crates.io | tree-sitter-kotlin-sg |
| lib.rs | tree-sitter-kotlin-sg |
| version | 0.4.0 |
| created_at | 2024-05-07 00:43:26.137417+00 |
| updated_at | 2024-12-08 20:03:51.823679+00 |
| description | Kotlin grammar for the tree-sitter parsing library |
| homepage | |
| repository | https://github.com/fwcd/tree-sitter-kotlin |
| max_upload_size | |
| id | 1231691 |
| size | 24,315,113 |
This crate provides a Kotlin grammar for the tree-sitter parsing library. To use this crate, add it to the [dependencies] section of your Cargo.toml file:
tree-sitter = "0.22"
tree-sitter-kotlin = "0.3.9"
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#"
data class Point(
val x: Int,
val y: Int
)
"#;
let mut parser = Parser::new();
parser.set_language(&tree_sitter_kotlin::language()).expect("Error loading Kotlin grammar");
let parsed = parser.parse(code, None);