Skip to content

tormodatt/tree-sitter-kotlin

This branch is 6 commits ahead of, 273 commits behind fwcd/tree-sitter-kotlin:main.

Folders and files

NameName
Last commit message
Last commit date
Dec 27, 2020
Mar 10, 2021
Mar 16, 2021
Aug 7, 2019
Mar 16, 2021
Jul 29, 2019
Oct 6, 2020
Mar 10, 2021
Jul 28, 2019
Jul 29, 2019
Dec 27, 2020
Mar 10, 2021
Aug 8, 2019
Mar 16, 2021
Mar 10, 2021
Mar 10, 2021
Aug 8, 2019

Repository files navigation

Kotlin Grammar for Tree-Sitter

Build

Kotlin language grammar for Tree-Sitter.

Icon

The grammar is based on the official language grammar.

Project Structure

File Description
grammar.js The Tree-Sitter grammar
grammar-reference.js A direct translation of the Kotlin language grammar that is, however, ambiguous to Tree-Sitter
src The generated parser

Setup

npm install

Development

Compilation

To (re-)compile the grammar, run:

npm run generate

Note that the grammar is written completely in JavaScript (grammar.js), the other source files are generated by tree-sitter.

Testing

To run the unit tests, run:

npm run test

WebAssembly

Compilation

First make sure to have Emscripten installed. If you use Homebrew, you can brew install emscripten. Then run:

npm run build-wasm

Web-UI

After compiling the grammar to WebAssembly, you can invoke

npm run web-ui

to launch an interactive editing environment that displays the parsed syntax tree on-the-fly:

Screenshot

Documentation

More documentation on how to create Tree-Sitter grammars can be found here.

See also

About

Kotlin grammar for Tree-Sitter

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 92.9%
  • Rust 5.2%
  • C++ 1.4%
  • Python 0.5%