tree-sitter-tact
tree-sitter-tact copied to clipboard
Tracking issue: Tact v1.5.0
Full changelog for Tact v1.5.0: https://github.com/tact-lang/tact/blob/main/CHANGELOG.md#150---2024-09-15
New Tact features:
asmfunctions:asm fun keccak256(s: Slice): Int { 1 INT HASHEXT_KECCAK256 };- Wider range of serialization options for integers —
uint1throughuint256andint1throughint257:counter: Int as uint48; - Allow omitting last semicolons in contract/trait declarations and definitions:
trait Test { abstract fun foo() }-- the semicolon afterfoo()is not required anymore.
New builtin and stdlib functions and methods:
- The
existsmethod for theMaptype:m.exists(key), equivalent tom.get(key) != null; - The
deepEqualsmethod for theMaptype:m1.deepEquals(m2); - The
toSlicemethod for structs and messages:struct.toSlice(); - The
storeBitmethod forBuildertype and theloadBitmethod forSlicetype (aliases forstoreBoolandloadBoolrespectively):b.storeBit(true),sl.loadBit(); slice,rawSlice,asciiandcrc32built-in functions;- Corresponding stdlib functions for the new TVM instructions from 2023.07 and 2024.04 upgrades:
storeBuilderextension function andgasConsumed,getComputeFee,getStorageFee,getForwardFee,getSimpleComputeFee,getSimpleForwardFee,getOriginalFwdFee,myStorageDuefunctions. Builder.storeMaybeRef,parseStdAddressandparseVarAddressstdlib functions.
Tracking progress
- [x] https://github.com/tact-lang/tree-sitter-tact/pull/40
- [x] New release: https://github.com/tact-lang/tree-sitter-tact/releases/tag/v1.5.0
- [x] Bugfix PR: #41
- [x] Bugfix release: https://github.com/tact-lang/tree-sitter-tact/releases/tag/v1.5.1
- [x] PR to Neovim's repos
- [x] https://github.com/nvim-treesitter/nvim-treesitter/pull/7196
- [ ] https://github.com/nvim-treesitter/nvim-treesitter-textobjects/pull/697
- [x] https://github.com/nvim-treesitter/nvim-treesitter-context/pull/494
P.S.: Consider removing the built-in functions from highlighting queries, as this generally hurts the highlighting more than it helps. New structs, messages and constants are better candidates for inclusion into queries.
Because of lack of lookaheads, implementing correct-ish asm function block parsing without resorting to external scanner (scanner.c) is quite tough. I'll try some more without it, but probably would have to make it anyways.
On the up side, making an external scanner here will help making https://github.com/tact-lang/tact/issues/837 later on
Let's just support some reasonable subset of Fift-asm for now, without creating an external scanner. For instance, the stuff in stdlib.fc and other common and important FunC contracts. Our wiki has a list of those: https://github.com/tact-lang/tact/wiki/FunC-contracts.
And document somewhere that our tree-sitter does not support the full syntax.
This was resolved long ago and only kept open because of the hanging PR to nvim-treesitter-textobjects. It's still there, but all other things were done, so let's close this issue as done too