tree-sitter-tolk

Crates.iotree-sitter-tolk
lib.rstree-sitter-tolk
version0.0.5
created_at2025-10-19 13:27:35.5354+00
updated_at2026-01-17 12:09:45.703882+00
descriptionTolk grammar for tree-sitter
homepage
repositoryhttps://github.com/ton-blockchain/tree-sitter-tolk
max_upload_size
id1890424
size2,089,376
Petr Makhnev (i582)

documentation

README

tree-sitter-tolk

Tolk grammar for tree-sitter.

How to update and test grammar

You should update grammar.js and/or grammar/ folder (required from js). Folders src, bindings, build, and files binding.gyp, Cargo.toml are auto-generated by tree-sitter.

After updating grammar, run:

tree-sitter generate

(will change src/).

To play with parser, you can run interactive playground:

yarn play

To manually test, create tmp.tolk with some content, and run:

tree-sitter parse tmp.tolk

To see all parsing steps run:

tree-sitter parse -D --open-log tmp.tolk

If you introduce new keywords, also modify queries/highlights.scm. This file is not needed for VS Code, but:

tree-sitter highlight tmp.tolk

produces colored output, just a pleasant feature, so keep this file up to date also.

Finally, to build wasm, run in the project folder:

yarn grammar:wasm

On finish, tree-sitter-tolk.wasm will be saved into the server/ folder.

Don't forget to run/update JS tests after modifying grammar!

Commit count: 24

cargo fmt