feat(tact): update parser and queries

This commit is contained in:
Christian Clason 2024-06-25 09:31:11 +02:00
parent 0c7a0ddaf4
commit 09700b88b4
4 changed files with 30 additions and 29 deletions

View file

@ -711,7 +711,7 @@
"revision": "b1170880c61355aaf38fc06f4af7d3c55abdabc4" "revision": "b1170880c61355aaf38fc06f4af7d3c55abdabc4"
}, },
"tact": { "tact": {
"revision": "034df2162ed7b654efd999942e266be713c7cde0" "revision": "91cc49a83f4f0b3a756bf7d0e65403a9cf757003"
}, },
"tcl": { "tcl": {
"revision": "8784024358c233efd0f3a6fd9e7a3c5852e628bc" "revision": "8784024358c233efd0f3a6fd9e7a3c5852e628bc"

View file

@ -1,6 +1,6 @@
[ [
; import … ; import …
(import_statement)+ (import)+
; (…, …) ; (…, …)
(parameter_list) (parameter_list)
(argument_list) (argument_list)

View file

@ -108,7 +108,7 @@
; string.special.path ; string.special.path
; ------------------- ; -------------------
(import_statement (import
library: (string) @string.special.path) library: (string) @string.special.path)
; boolean ; boolean
@ -117,7 +117,10 @@
; constant ; constant
; -------- ; --------
(constant (global_constant
name: (identifier) @constant)
(storage_constant
name: (identifier) @constant) name: (identifier) @constant)
; constant.builtin ; constant.builtin
@ -142,17 +145,12 @@
(field_access_expression (field_access_expression
name: (identifier) @variable.member) name: (identifier) @variable.member)
(trait_body
(constant
name: (identifier) @variable.member))
(contract_body
(constant
name: (identifier) @variable.member))
(field (field
name: (identifier) @variable.member) name: (identifier) @variable.member)
(storage_variable
name: (identifier) @variable.member)
; number ; number
; ------ ; ------
(integer) @number (integer) @number
@ -248,7 +246,7 @@
(native_function (native_function
name: (identifier) @function) name: (identifier) @function)
(static_function (global_function
name: (identifier) @function) name: (identifier) @function)
(func_identifier) @function (func_identifier) @function
@ -267,7 +265,7 @@
(external_function (external_function
"external" @function.method) "external" @function.method)
(function (storage_function
name: (identifier) @function.method) name: (identifier) @function.method)
; function.call ; function.call
@ -289,19 +287,19 @@
"contractAddress" "contractAddressExt" "emit" "cell" "ton" "dump" "dumpStack" "beginString" "contractAddress" "contractAddressExt" "emit" "cell" "ton" "dump" "dumpStack" "beginString"
"beginComment" "beginTailString" "beginStringFromBuilder" "beginCell" "emptyCell" "randomInt" "beginComment" "beginTailString" "beginStringFromBuilder" "beginCell" "emptyCell" "randomInt"
"random" "checkSignature" "checkDataSignature" "sha256" "min" "max" "abs" "pow" "pow2" "throw" "random" "checkSignature" "checkDataSignature" "sha256" "min" "max" "abs" "pow" "pow2" "throw"
"nativeThrowWhen" "nativeThrowUnless" "getConfigParam" "nativeRandomize" "nativeRandomizeLt" "nativeThrowIf" "nativeThrowUnless" "getConfigParam" "nativeRandomize" "nativeRandomizeLt"
"nativePrepareRandom" "nativeRandom" "nativeRandomInterval" "nativeReserve")) "nativePrepareRandom" "nativeRandom" "nativeRandomInterval" "nativeReserve"))
; comment
; -------
(comment) @comment @spell
((comment) @comment.documentation
(#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$"))
; attribute ; attribute
; --------- ; ---------
[ [
"@name" "@name"
"@interface" "@interface"
] @attribute ] @attribute
; comment
; -------
(comment) @comment @spell
((comment) @comment.documentation
(#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$"))

View file

@ -1,12 +1,12 @@
; Scopes @local.scope ; Scopes @local.scope
; ------------------------- ; -------------------------
[ [
(static_function) (global_function)
(init_function) (init_function)
(bounced_function) (bounced_function)
(receive_function) (receive_function)
(external_function) (external_function)
(function) (storage_function)
(block_statement) (block_statement)
] @local.scope ] @local.scope
@ -17,11 +17,14 @@
name: (identifier) @local.definition.var) name: (identifier) @local.definition.var)
; constants ; constants
(constant (global_constant
name: (identifier) @local.definition.constant)
(storage_constant
name: (identifier) @local.definition.constant) name: (identifier) @local.definition.constant)
; functions ; functions
(static_function (global_function
name: (identifier) @local.definition.function name: (identifier) @local.definition.function
(#set! definition.var.scope parent)) (#set! definition.var.scope parent))
@ -42,7 +45,7 @@
"external" @local.definition.method "external" @local.definition.method
(#set! definition.var.scope parent)) (#set! definition.var.scope parent))
(function (storage_function
name: (identifier) @local.definition.method name: (identifier) @local.definition.method
(#set! definition.var.scope parent)) (#set! definition.var.scope parent))
@ -53,12 +56,12 @@
; user-defined types (structs and messages) ; user-defined types (structs and messages)
(type_identifier) @local.definition.type (type_identifier) @local.definition.type
; fields (and properties) ; fields (of messages and structs)
(field (field
name: (identifier) @local.definition.field) name: (identifier) @local.definition.field)
; imports ; imports
(import_statement (import
(string) @local.definition.import) (string) @local.definition.import)
; References @local.reference ; References @local.reference