difftastic/bindings/rust
fwcd 203348915b Bump version to 0.3.1 for development 2023-10-02 20:11:57 +07:00
..
README.md Bump version to 0.3.1 for development 2023-10-02 20:11:57 +07:00
build.rs add scanner.c to build.rs 2021-11-10 11:15:18 +07:00
lib.rs regenerate with tree-sitter-cli 19.2 2021-06-03 23:49:59 +07:00

README.md

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

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