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

This commit is contained in:
Novus Nota 2025-03-12 18:26:07 +01:00 committed by GitHub
parent 1a314a58d6
commit 6d1a8e6fdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 62 additions and 10 deletions

View file

@ -795,7 +795,7 @@
"revision": "b1170880c61355aaf38fc06f4af7d3c55abdabc4"
},
"tact": {
"revision": "83e264928fa194b7283428527259e88e54205264"
"revision": "a19be2d4c1956e12facfc717e28f13a6ad0860e0"
},
"tcl": {
"revision": "98015ebe182d94e5a4439e32ffd91beaac32fcb9"

View file

@ -6,6 +6,7 @@
(argument_list)
; {…, …}
(instance_argument_list)
(destruct_bind_list)
; {…; …}
(message_body)
(struct_body)
@ -14,5 +15,6 @@
(function_body)
(block_statement)
(asm_function_body)
(asm_list)
; <{ … }>
(asm_sequence)
] @fold

View file

@ -2,6 +2,10 @@
; --------
(identifier) @variable
(destruct_bind
name: (identifier) @variable.member
bind: (identifier) @variable)
; variable.builtin
; ----------------
(self) @variable.builtin
@ -51,15 +55,23 @@
"<"
"<="
"<<"
"<<="
">"
">="
">>"
">>="
"&"
"&="
"|"
"|="
"^"
"^="
"&&"
"&&="
"||"
"||="
"->"
".."
] @operator
; constructor
@ -70,6 +82,9 @@
(initOf
name: (identifier) @constructor)
(codeOf
name: (identifier) @constructor)
; type
; ----
(type_identifier) @type
@ -79,6 +94,10 @@
((identifier) @type.builtin
(#any-of? @type.builtin "Context" "SendParameters" "StateInit" "StdAddress" "VarAddress"))
(generic_parameter_list
"<" @punctuation.bracket
">" @punctuation.bracket)
(bounced_type
"bounced" @type.builtin
"<" @punctuation.bracket
@ -94,7 +113,7 @@
(tlb_serialization
"as" @keyword
type: (identifier) @type.builtin)
type: (identifier) @type)
; string
; ------
@ -107,7 +126,7 @@
; string.special.path
; -------------------
(import
library: (string) @string.special.path)
name: (string) @string.special.path)
; boolean
; -------
@ -127,10 +146,10 @@
((identifier) @constant.builtin
(#any-of? @constant.builtin
"SendBounceIfActionFail" "SendPayGasSeparately" "SendIgnoreErrors" "SendDestroyIfZero"
"SendRemainingValue" "SendRemainingBalance" "SendOnlyEstimateFee" "ReserveExact"
"ReserveAllExcept" "ReserveAtMost" "ReserveAddOriginalBalance" "ReserveInvertSign"
"ReserveBounceIfActionFail"))
"SendDefaultMode" "SendBounceIfActionFail" "SendPayGasSeparately" "SendIgnoreErrors"
"SendDestroyIfZero" "SendRemainingValue" "SendRemainingBalance" "SendOnlyEstimateFee"
"ReserveExact" "ReserveAllExcept" "ReserveAtMost" "ReserveAddOriginalBalance"
"ReserveInvertSign" "ReserveBounceIfActionFail"))
; property
; --------
@ -181,6 +200,8 @@
; ----------------
"initOf" @keyword.operator
"codeOf" @keyword.operator
; keyword.import
; --------------
"import" @keyword.import
@ -277,6 +298,35 @@
(method_call_expression
name: (identifier) @function.method.call)
; asm-specific
; ------------
(tvm_instruction) @function.call
(asm_integer) @number
(asm_string) @string
(asm_control_register) @string.special.symbol
(asm_stack_register) @string.special.symbol
(asm_hex_bitstring) @function.macro
(asm_bin_bitstring) @function.macro
(asm_boc_hex) @function.macro
(asm_cont_name) @variable
; within asm_sequence
[
"<{"
"}>"
"}>c"
"}>s"
"}>CONT"
] @punctuation.bracket
; attribute
; ---------
[

View file

@ -6,6 +6,7 @@
(argument_list)
; {..., ...}
(instance_argument_list)
(destruct_bind_list)
; {...; ...}
(message_body)
(struct_body)
@ -14,7 +15,6 @@
(function_body)
(block_statement)
(asm_function_body)
(asm_list)
; misc.
(binary_expression)
(ternary_expression)

View file

@ -70,7 +70,7 @@
; imports
(import
(string) @local.definition.import)
name: (string) @local.definition.import)
; References @local.reference
; -----------------------------