#tree-sitter #kotlin #incremental #parser #cargo-toml

tree-sitter-kotlin

Kotlin grammar for the tree-sitter parsing library

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

#59 in Text editors

Download history 1209/week @ 2024-09-20 980/week @ 2024-09-27 891/week @ 2024-10-04 972/week @ 2024-10-11 987/week @ 2024-10-18 1076/week @ 2024-10-25 1011/week @ 2024-11-01 689/week @ 2024-11-08 1200/week @ 2024-11-15 1163/week @ 2024-11-22 1355/week @ 2024-11-29 1082/week @ 2024-12-06 759/week @ 2024-12-13 587/week @ 2024-12-20 405/week @ 2024-12-27 653/week @ 2025-01-03

2,548 downloads per month
Used in 12 crates (8 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

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

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

Dependencies

~2.7–4MB
~76K SLoC