Open anton-trunov opened 1 month ago
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.
Full changelog for Tact v1.5.0: https://github.com/tact-lang/tact/blob/main/CHANGELOG.md#150---2024-09-15
New Tact features:
asm
functions:asm fun keccak256(s: Slice): Int { 1 INT HASHEXT_KECCAK256 }
;uint1
throughuint256
andint1
throughint257
:counter: Int as uint48
;trait Test { abstract fun foo() }
-- the semicolon afterfoo()
is not required anymore.New builtin and stdlib functions and methods:
exists
method for theMap
type:m.exists(key)
, equivalent tom.get(key) != null
;deepEquals
method for theMap
type:m1.deepEquals(m2)
;toSlice
method for structs and messages:struct.toSlice()
;storeBit
method forBuilder
type and theloadBit
method forSlice
type (aliases forstoreBool
andloadBool
respectively):b.storeBit(true)
,sl.loadBit()
;slice
,rawSlice
,ascii
andcrc32
built-in functions;storeBuilder
extension function andgasConsumed
,getComputeFee
,getStorageFee
,getForwardFee
,getSimpleComputeFee
,getSimpleForwardFee
,getOriginalFwdFee
,myStorageDue
functions.Builder.storeMaybeRef
,parseStdAddress
andparseVarAddress
stdlib functions.Tracking progress
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.