aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNovus Nota <68142933+novusnota@users.noreply.github.com>2025-03-12 18:26:07 +0100
committerGitHub <noreply@github.com>2025-03-12 18:26:07 +0100
commit6d1a8e6fdb562aab59e0f67e7aef23cc5b23e283 (patch)
treeff9727dbe1af8236497e4518f0d778263cf31b3c
parentfix(python): highlight function calls correctly (#7728) (diff)
downloadnvim-treesitter-6d1a8e6fdb562aab59e0f67e7aef23cc5b23e283.tar
nvim-treesitter-6d1a8e6fdb562aab59e0f67e7aef23cc5b23e283.tar.gz
nvim-treesitter-6d1a8e6fdb562aab59e0f67e7aef23cc5b23e283.tar.bz2
nvim-treesitter-6d1a8e6fdb562aab59e0f67e7aef23cc5b23e283.tar.lz
nvim-treesitter-6d1a8e6fdb562aab59e0f67e7aef23cc5b23e283.tar.xz
nvim-treesitter-6d1a8e6fdb562aab59e0f67e7aef23cc5b23e283.tar.zst
nvim-treesitter-6d1a8e6fdb562aab59e0f67e7aef23cc5b23e283.zip
feat(tact): update parser and queries (#7731)
-rw-r--r--lockfile.json2
-rw-r--r--queries/tact/folds.scm4
-rw-r--r--queries/tact/highlights.scm62
-rw-r--r--queries/tact/indents.scm2
-rw-r--r--queries/tact/locals.scm2
5 files changed, 62 insertions, 10 deletions
diff --git a/lockfile.json b/lockfile.json
index 6c7bace9b..6d404d243 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -795,7 +795,7 @@
"revision": "b1170880c61355aaf38fc06f4af7d3c55abdabc4"
},
"tact": {
- "revision": "83e264928fa194b7283428527259e88e54205264"
+ "revision": "a19be2d4c1956e12facfc717e28f13a6ad0860e0"
},
"tcl": {
"revision": "98015ebe182d94e5a4439e32ffd91beaac32fcb9"
diff --git a/queries/tact/folds.scm b/queries/tact/folds.scm
index 66e7bdaa9..adade3f1c 100644
--- a/queries/tact/folds.scm
+++ b/queries/tact/folds.scm
@@ -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
diff --git a/queries/tact/highlights.scm b/queries/tact/highlights.scm
index d65b501cf..345ca299c 100644
--- a/queries/tact/highlights.scm
+++ b/queries/tact/highlights.scm
@@ -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
; ---------
[
diff --git a/queries/tact/indents.scm b/queries/tact/indents.scm
index b26ce1460..1d05d4d82 100644
--- a/queries/tact/indents.scm
+++ b/queries/tact/indents.scm
@@ -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)
diff --git a/queries/tact/locals.scm b/queries/tact/locals.scm
index 042afb941..547ee42c8 100644
--- a/queries/tact/locals.scm
+++ b/queries/tact/locals.scm
@@ -70,7 +70,7 @@
; imports
(import
- (string) @local.definition.import)
+ name: (string) @local.definition.import)
; References @local.reference
; -----------------------------