tree-sitter / kotlin-tree-sitter

Kotlin bindings to the Tree-sitter parsing library
https://tree-sitter.github.io/kotlin-tree-sitter/
MIT License
11 stars 1 forks source link

Kotlin/JS DSL for grammars #6

Open ObserverOfTime opened 5 months ago

ObserverOfTime commented 5 months ago

It should be possible to rewrite the grammar DSL in Kotlin/JS. Grammar authors can then write the grammar in grammar.kts and the DSL package will transpile it to JSON. Think Rust Sitter but in a better language. ;)

l-xiaoshen commented 4 months ago

I'm also making a kotlin DSL for tree sitter grammar rn, with ide support. However it targets JVM.

An equivalent tree-sitter-json grammar in DSL

https://gist.github.com/l-xiaoshen/c56c0d87730897a0d439396265617da4

image image image