#kotlin #incremental #parser #cargo-toml

tree-sitter-kotlin

Kotlin grammar for the tree-sitter parsing library

9 releases

0.3.5 Mar 13, 2024
0.3.4 Mar 13, 2024
0.3.1 Oct 6, 2023
0.2.11 Oct 11, 2021
0.2.8 Sep 20, 2021

#56 in Text editors

Download history 752/week @ 2023-12-20 703/week @ 2023-12-27 840/week @ 2024-01-03 771/week @ 2024-01-10 699/week @ 2024-01-17 719/week @ 2024-01-24 1235/week @ 2024-01-31 1247/week @ 2024-02-07 1211/week @ 2024-02-14 1699/week @ 2024-02-21 854/week @ 2024-02-28 995/week @ 2024-03-06 1215/week @ 2024-03-13 1117/week @ 2024-03-20 956/week @ 2024-03-27 860/week @ 2024-04-03

4,313 downloads per month
Used in 4 crates (3 directly)

MIT license

24MB
683K SLoC

C 682K SLoC // 0.0% comments JavaScript 891 SLoC // 0.1% comments Scheme 294 SLoC // 0.1% comments Rust 34 SLoC // 0.4% 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.20"
tree-sitter-kotlin = "0.3.5"

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
~71K SLoC