feat(tact): update parser and queries (#7196)

This commit is contained in:
Novus Nota 2024-10-09 09:21:33 +02:00 committed by GitHub
parent 009e981c30
commit 9d2acd4997
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 19 deletions

View file

@ -13,4 +13,6 @@
(trait_body)
(function_body)
(block_statement)
(asm_function_body)
(asm_list)
] @fold

View file

@ -59,6 +59,7 @@
"^"
"&&"
"||"
"->"
] @operator
; constructor
@ -76,7 +77,7 @@
; type.builtin
; ------------
((identifier) @type.builtin
(#eq? @type.builtin "SendParameters"))
(#any-of? @type.builtin "Context" "SendParameters" "StateInit" "StdAddress" "VarAddress"))
(bounced_type
"bounced" @type.builtin
@ -93,10 +94,7 @@
(tlb_serialization
"as" @keyword
type: (identifier) @type.builtin
(#any-of? @type.builtin
"int8" "int16" "int32" "int64" "int128" "int256" "int257" "uint8" "uint16" "uint32" "uint64"
"uint128" "uint256" "coins" "remaining" "bytes32" "bytes64"))
type: (identifier) @type.builtin)
; string
; ------
@ -130,8 +128,9 @@
((identifier) @constant.builtin
(#any-of? @constant.builtin
"SendBounceIfActionFail" "SendPayGasSeparately" "SendIgnoreErrors" "SendDestroyIfZero"
"SendRemainingValue" "SendRemainingBalance" "ReserveExact" "ReserveAllExcept" "ReserveAtMost"
"ReserveAddOriginalBalance" "ReserveInvertSign" "ReserveBounceIfActionFail"))
"SendRemainingValue" "SendRemainingBalance" "SendOnlyEstimateFee" "ReserveExact"
"ReserveAllExcept" "ReserveAtMost" "ReserveAddOriginalBalance" "ReserveInvertSign"
"ReserveBounceIfActionFail"))
; property
; --------
@ -175,6 +174,7 @@
[
"fun"
"native"
"asm"
] @keyword.function
; keyword.operator
@ -242,6 +242,9 @@
(native_function
name: (identifier) @function)
(asm_function
name: (identifier) @function)
(global_function
name: (identifier) @function)
@ -274,18 +277,6 @@
(method_call_expression
name: (identifier) @function.method.call)
; function.builtin
; ----------------
(static_call_expression
name: (identifier) @function.builtin
(#any-of? @function.builtin
"log" "log2" "send" "sender" "require" "now" "myBalance" "myAddress" "newAddress"
"contractAddress" "contractAddressExt" "emit" "cell" "ton" "dump" "dumpStack" "beginString"
"beginComment" "beginTailString" "beginStringFromBuilder" "beginCell" "emptyCell" "randomInt"
"random" "checkSignature" "checkDataSignature" "sha256" "min" "max" "abs" "pow" "pow2" "throw"
"nativeThrowIf" "nativeThrowUnless" "getConfigParam" "nativeRandomize" "nativeRandomizeLt"
"nativePrepareRandom" "nativeRandom" "nativeRandomInterval" "nativeReserve"))
; attribute
; ---------
[

View file

@ -13,6 +13,8 @@
(trait_body)
(function_body)
(block_statement)
(asm_function_body)
(asm_list)
; misc.
(binary_expression)
(ternary_expression)

View file

@ -1,6 +1,7 @@
; Scopes @local.scope
; -------------------------
[
(asm_function)
(global_function)
(init_function)
(bounced_function)
@ -13,6 +14,9 @@
; Definitions @local.definition
; ------------------------------
; variables
(storage_variable
name: (identifier) @local.definition.var)
(let_statement
name: (identifier) @local.definition.var)
@ -24,6 +28,10 @@
name: (identifier) @local.definition.constant)
; functions
(asm_function
name: (identifier) @local.definition.function
(#set! definition.var.scope parent))
(global_function
name: (identifier) @local.definition.function
(#set! definition.var.scope parent))