3 unstable releases

0.4.0 Dec 8, 2024
0.3.7 May 7, 2024
0.3.6 May 7, 2024

#41 in Parser tooling

Download history 9/week @ 2024-11-27 538/week @ 2024-12-04 1145/week @ 2024-12-11 605/week @ 2024-12-18 1038/week @ 2024-12-25 775/week @ 2025-01-01 882/week @ 2025-01-08 527/week @ 2025-01-15 1810/week @ 2025-01-22 5133/week @ 2025-01-29 4960/week @ 2025-02-05 4139/week @ 2025-02-12 5759/week @ 2025-02-19 6758/week @ 2025-02-26 7391/week @ 2025-03-05

24,821 downloads per month
Used in ast-grep-language

MIT license

24MB
686K SLoC

C 685K SLoC // 0.0% comments JavaScript 899 SLoC // 0.1% comments Scheme 294 SLoC // 0.1% comments Rust 35 SLoC // 0.3% comments

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

lib.rs:

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_sg::LANGUAGE.into()).expect("Error loading kotlin grammar");
let tree = parser.parse(code, None).unwrap();

Dependencies