Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nickshatilo/tree-sitter-tlb
TL-B tree-sitter grammar
https://github.com/nickshatilo/tree-sitter-tlb
nvim tlb ton tree-sitter
Last synced: 17 days ago
JSON representation
TL-B tree-sitter grammar
- Host: GitHub
- URL: https://github.com/nickshatilo/tree-sitter-tlb
- Owner: nickshatilo
- Created: 2024-08-28T06:03:22.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-01-26T14:00:29.000Z (25 days ago)
- Last Synced: 2025-01-26T15:18:31.986Z (25 days ago)
- Topics: nvim, tlb, ton, tree-sitter
- Language: JavaScript
- Homepage:
- Size: 58.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tree-sitter-tlb
A Tree-sitter grammar for the [TL-B](https://docs.ton.org/v3/documentation/data-formats/tlb/tl-b-language) language.
Includes nvim bindings.
## Installation
Lazy.nvim:
```lua
{
'nickshatilo/tree-sitter-tlb',
lazy = false,
opts = {},
}
```Then, just run `:TSInstall tlb`
## Grammar references
* [Official docs](https://docs.ton.org/v3/documentation/data-formats/tlb/tl-b-language)
* [TL-B parser](https://github.com/ton-community/tlb-parser)
* [Native TL-B types](https://github.com/ton-blockchain/ton/blob/master/crypto/block/block.tlb)## Func comments injections
I also like to have TL-B schemes highlighted right inside func files, so if you want you could add the following to your ~/.config/nvim/queries/func/injections.scm file:
```
(
(comment) @injection.content
(#match? @injection.content "\\{-TLB(.*)-\\}")
(#offset! @injection.content 0 5 0 -2)
(#set! injection.language "tlb")
)
```So inside func files you could have highlighting inside the comments:
```func
{-TLB
addr_none$00 = MsgAddressExt;
-}
```## TODO:
* Add TL-B into official [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) grammars