Socket
Socket
Sign inDemoInstall

tree-sitter-kotlin

Package Overview
Dependencies
3
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tree-sitter-kotlin

Tree-sitter grammar for Kotlin


Version published
Weekly downloads
3.1K
increased by27.18%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Kotlin Grammar for Tree-sitter

Build NPM crates.io

Kotlin language grammar for Tree-sitter. You can try it out directly on the web.

Icon

The grammar is based on the official language grammar.

Project Structure

FileDescription
grammar.jsThe Tree-sitter grammar
grammar-reference.jsA direct translation of the Kotlin language grammar that is, however, ambiguous to Tree-sitter
srcThe 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

Playground

After compiling the grammar to WebAssembly, you can invoke

npm run playground

to launch an interactive editing environment that displays the parsed syntax tree on-the-fly in the browser. You can also view a deployed version of this playground on the web.

Screenshot

Documentation

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

See also

Keywords

FAQs

Last updated on 13 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc