12 releases

0.3.8 Aug 3, 2024
0.3.7 Jul 29, 2024
0.3.6 May 7, 2024
0.3.5 Mar 13, 2024
0.2.8 Sep 20, 2021

#565 in Parser implementations

Download history 922/week @ 2025-08-25 1511/week @ 2025-09-01 1031/week @ 2025-09-08 2394/week @ 2025-09-15 3842/week @ 2025-09-22 5094/week @ 2025-09-29 4333/week @ 2025-10-06 4190/week @ 2025-10-13 6187/week @ 2025-10-20 6434/week @ 2025-10-27 4711/week @ 2025-11-03 5244/week @ 2025-11-10 5864/week @ 2025-11-17 5621/week @ 2025-11-24 6285/week @ 2025-12-01 6324/week @ 2025-12-08

24,839 downloads per month
Used in 14 crates (10 directly)

MIT license

24MB
680K SLoC

C 679K SLoC // 0.0% comments JavaScript 896 SLoC // 0.1% comments Scheme 294 SLoC // 0.1% comments Rust 37 SLoC // 0.3% comments

This crate provides kotlin language support for the tree-sitter parsing library.

Typically, you will use the language function to add this language to a tree-sitter Parser, and then use the parser to parse some code:

let code = "";
let mut parser = tree_sitter::Parser::new();
parser.set_language(&tree_sitter_kotlin::language()).expect("Error loading kotlin grammar");
let tree = parser.parse(code, None).unwrap();

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);

Dependencies

~2.6–4MB
~72K SLoC