https://github.com/ton-blockchain/tree-sitter-tolk
Tolk grammar for tree-sitter
https://github.com/ton-blockchain/tree-sitter-tolk
parser tolk tree-sitter
Last synced: about 1 month ago
JSON representation
Tolk grammar for tree-sitter
- Host: GitHub
- URL: https://github.com/ton-blockchain/tree-sitter-tolk
- Owner: ton-blockchain
- License: mit
- Created: 2025-07-10T13:56:52.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-12-16T22:43:42.000Z (6 months ago)
- Last Synced: 2025-12-20T13:14:59.688Z (6 months ago)
- Topics: parser, tolk, tree-sitter
- Language: JavaScript
- Homepage:
- Size: 903 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- License: LICENSE
Awesome Lists containing this project
README
# tree-sitter-tolk
Tolk grammar for [tree-sitter](https://github.com/tree-sitter/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:
```bash
tree-sitter generate
```
(will change `src/`).
To play with parser, you can run interactive playground:
```bash
yarn play
```
To manually test, create `tmp.tolk` with some content, and run:
```bash
tree-sitter parse tmp.tolk
```
To see all parsing steps run:
```bash
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:
```bash
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**:
```bash
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!