1010
1111" stdlib_functions {{{2
1212let s: tact_stdlib_functions = {
13- \ ' send(SendParameters{' : ' Int'
13+ \ ' send(SendParameters{' : ' '
14+ \ , ' message(MessageParameters{' : ' '
15+ \ , ' deploy(DeployParameters{' : ' '
16+ \ , ' cashback(' : ' '
1417 \ , ' sender()' : ' Address'
1518 \ , ' require(' : ' '
1619 \ , ' now()' : ' Int'
20+ \ , ' curLt()' : ' Int'
21+ \ , ' blockLt()' : ' Int'
1722 \ , ' address(' : ' Address'
1823 \ , ' myBalance()' : ' Int'
1924 \ , ' myAddress()' : ' Address'
2025 \ , ' newAddress(' : ' Address'
26+ \ , ' emptyBasechainAddress()' : ' BasechainAddress'
27+ \ , ' newBasechainAddress(' : ' BasechainAddress'
2128 \ , ' contractAddress(' : ' Address'
29+ \ , ' contractBasechainAddress(' : ' BasechainAddress'
2230 \ , ' contractAddressExt(' : ' Address'
31+ \ , ' contractHash(' : ' Int'
2332 \ , ' emit(' : ' '
2433 \ , ' cell(' : ' Cell'
2534 \ , ' ton(' : ' Int'
@@ -43,26 +52,37 @@ let s:tact_stdlib_functions = {
4352 \ , ' log2(' : ' Int'
4453 \ , ' pow(' : ' Int'
4554 \ , ' pow2(' : ' Int'
55+ \ , ' sign(' : ' Int'
56+ \ , ' sqrt(' : ' Int'
57+ \ , ' divc(' : ' Int'
58+ \ , ' muldivc(' : ' Int'
59+ \ , ' mulShiftRight(' : ' Int'
60+ \ , ' mulShiftRightRound(' : ' Int'
61+ \ , ' mulShiftRightCeil(' : ' Int'
4662 \ , ' throw(' : ' '
47- \ , ' nativeThrowIf (' : ' '
48- \ , ' nativeThrowUnless (' : ' '
63+ \ , ' throwIf (' : ' '
64+ \ , ' throwUnless (' : ' '
4965 \ , ' getConfigParam(' : ' Cell?'
5066 \ , ' nativeRandomize(' : ' '
5167 \ , ' nativeRandomizeLt()' : ' '
5268 \ , ' nativePrepareRandom(' : ' '
5369 \ , ' nativeRandom()' : ' Int'
5470 \ , ' nativeRandomInterval(' : ' Int'
71+ \ , ' getSeed()' : ' Int'
72+ \ , ' setSeed(' : ' '
5573 \ , ' nativeReserve(' : ' '
5674 \ , ' nativeSendMessage(' : ' '
5775 \ , ' nativeSendMessageReturnForwardFee(' : ' Int'
5876 \ , ' gasConsumed()' : ' Int'
77+ \ , ' setGasLimit(' : ' '
5978 \ , ' getComputeFee(' : ' Int'
6079 \ , ' getStorageFee(' : ' Int'
6180 \ , ' getForwardFee(' : ' Int'
6281 \ , ' getSimpleComputeFee(' : ' Int'
6382 \ , ' getSimpleForwardFee(' : ' Int'
6483 \ , ' getOriginalFwdFee(' : ' Int'
6584 \ , ' myStorageDue()' : ' Int'
85+ \ , ' myCode()' : ' Cell'
6686 \ , ' parseStdAddress(' : ' StdAddress'
6787 \ , ' parseVarAddress(' : ' VarAddress'
6888 \ , ' slice(' : ' Slice'
@@ -77,13 +97,15 @@ let s:tact_globals = {
7797 \ , ' SendIgnoreErrors' : ' Int'
7898 \ , ' SendBounceIfActionFail' : ' Int'
7999 \ , ' SendDestroyIfZero' : ' Int'
100+ \ , ' SendDefaultMode' : ' Int'
80101 \ , ' SendRemainingValue' : ' Int'
81102 \ , ' SendRemainingBalance' : ' Int'
82103 \ , ' SendOnlyEstimateFee' : ' Int'
83104 \ , ' SendParameters{' : ' SendParameters'
84105 \ , ' StateInit{' : ' StateInit'
85106 \ , ' StdAddress{' : ' StdAddress'
86107 \ , ' VarAddress{' : ' VarAddress'
108+ \ , ' BasechainAddress{' : ' BasechainAddress'
87109 \ , ' ReserveExact' : ' Int'
88110 \ , ' ReserveAllExcept' : ' Int'
89111 \ , ' ReserveAtMost' : ' Int'
@@ -95,7 +117,9 @@ let s:tact_globals = {
95117let s: tact_Map_methods = {
96118 \ ' get(' : ' '
97119 \ , ' set(' : ' '
98- \ , ' del(' : ' '
120+ \ , ' replace(' : ' Bool'
121+ \ , ' replaceGet(' : ' '
122+ \ , ' del(' : ' Bool'
99123 \ , ' asCell()' : ' Cell'
100124 \ , ' isEmpty(' : ' Bool'
101125 \ , ' exists(' : ' Bool'
@@ -117,6 +141,7 @@ let s:tact_StringBuilder_methods = {
117141let s: tact_String_methods = {
118142 \ ' asComment()' : ' Cell'
119143 \ , ' asSlice()' : ' Slice'
144+ \ , ' hashData()' : ' Int'
120145 \ , ' fromBase64()' : ' Slice'
121146 \ }
122147
@@ -135,17 +160,25 @@ let s:tact_Builder_methods = {
135160 \ , ' storeBuilder(' : ' Builder'
136161 \ , ' storeSlice(' : ' Builder'
137162 \ , ' storeCoins(' : ' Builder'
163+ \ , ' storeVarUint16(' : ' Builder'
164+ \ , ' storeVarUint32(' : ' Builder'
165+ \ , ' storeVarInt16(' : ' Builder'
166+ \ , ' storeVarInt32(' : ' Builder'
138167 \ , ' storeAddress(' : ' Builder'
139168 \ , ' storeRef(' : ' Builder'
140169 \ , ' storeMaybeRef(' : ' Builder'
170+ \ , ' storeBasechainAddress(' : ' Builder'
141171 \ , ' refs()' : ' Int'
142172 \ , ' bits()' : ' Int'
173+ \ , ' depth()' : ' Int'
143174 \ , ' asSlice()' : ' Slice'
144175 \ , ' asCell()' : ' Cell'
145176 \ }
146177
147178let s: tact_Cell_methods = {
148179 \ ' beginParse()' : ' Slice'
180+ \ , ' depth()' : ' Int'
181+ \ , ' computeDataSize()' : ' Int'
149182 \ , ' hash()' : ' Int'
150183 \ , ' asSlice()' : ' Slice'
151184 \ }
@@ -161,16 +194,32 @@ let s:tact_Slice_methods = {
161194 \ , ' loadBool(' : ' Bool'
162195 \ , ' loadBits(' : ' Slice'
163196 \ , ' preloadBits(' : ' Slice'
197+ \ , ' skipBits(' : ' '
198+ \ , ' skipLastBits(' : ' '
199+ \ , ' firstBits(' : ' Slice'
200+ \ , ' lastBits(' : ' Slice'
164201 \ , ' loadCoins()' : ' Int'
202+ \ , ' loadVarUint16(' : ' Int'
203+ \ , ' loadVarUint32(' : ' Int'
204+ \ , ' loadVarInt16(' : ' Int'
205+ \ , ' loadVarInt32(' : ' Int'
165206 \ , ' loadAddress(' : ' Address'
166207 \ , ' loadRef()' : ' Cell'
208+ \ , ' preloadRef()' : ' Cell'
209+ \ , ' loadMaybeRef()' : ' Cell?'
210+ \ , ' preloadMaybeRef()' : ' Cell?'
167211 \ , ' refs()' : ' Int'
168212 \ , ' bits()' : ' Int'
213+ \ , ' depth()' : ' Int'
169214 \ , ' empty()' : ' Bool'
170215 \ , ' dataEmpty()' : ' Bool'
171216 \ , ' refsEmpty()' : ' Bool'
217+ \ , ' computeDataSize()' : ' Int'
172218 \ , ' hash()' : ' Int'
219+ \ , ' hashData()' : ' Int'
173220 \ , ' asCell()' : ' Cell'
221+ \ , ' asAddress()' : ' Address'
222+ \ , ' asAddressUnsafe()' : ' Address'
174223 \ }
175224
176225let s: tact_stdlib_deploy = [
@@ -245,6 +294,7 @@ let s:tact_types = [
245294" NOTE: Pre-computed the values, because producing them on the fly isn't very convenient in VimScript
246295let s: tact_native_types = [
247296 \ ' int257' , ' coins' , ' remaining' , ' bytes32' , ' bytes64'
297+ \ , ' varuint16' , ' varuint32' , ' varint16' , ' varint32'
248298 \ , ' int1' , ' int2' , ' int3' , ' int4' , ' int5' , ' int6' , ' int7' , ' int8'
249299 \ , ' int9' , ' int10' , ' int11' , ' int12' , ' int13' , ' int14' , ' int15' , ' int16'
250300 \ , ' int17' , ' int18' , ' int19' , ' int20' , ' int21' , ' int22' , ' int23' , ' int24'
@@ -2094,6 +2144,15 @@ function! tact#Complete(findstart, base) abort
20942144 continue
20952145 endif
20962146
2147+ " TODO: can try add parsing for contract parameters on the same line
2148+ " but: a) it's not a frequent case and b) this is a very brittle
2149+ " parsing-ish approach, and I'd better just either rewrite this
2150+ " as a top-down parser generated from the grammar.gg definition
2151+ " or simply leave things as is for the time being.
2152+ "
2153+ " if anything — there's a smarter LS that supports way more edge-cases.
2154+ " see: https://github.com/tact-lang/tact-language-server
2155+
20972156 " parsing a field
20982157 if l: buf_line = ~# ' ^\%(const\s\+\)\?\w\+\s*:'
20992158 " extract name
0 commit comments