tree-sitter-kotlin

Crates.iotree-sitter-kotlin
lib.rstree-sitter-kotlin
version0.3.8
sourcesrc
created_at2021-09-20 14:37:01.098844
updated_at2024-08-03 00:17:37.694304
descriptionKotlin grammar for the tree-sitter parsing library
homepage
repositoryhttps://github.com/fwcd/tree-sitter-kotlin
max_upload_size
id454045
size24,055,154
fwcd (fwcd)

documentation

README

Kotlin Grammar for Tree-sitter

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.8"

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);
Commit count: 309

cargo fmt