diff options
| author | Novus Nota <68142933+novusnota@users.noreply.github.com> | 2025-03-12 18:26:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-12 18:26:07 +0100 |
| commit | 6d1a8e6fdb562aab59e0f67e7aef23cc5b23e283 (patch) | |
| tree | ff9727dbe1af8236497e4518f0d778263cf31b3c /queries | |
| parent | fix(python): highlight function calls correctly (#7728) (diff) | |
| download | nvim-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)
Diffstat (limited to 'queries')
| -rw-r--r-- | queries/tact/folds.scm | 4 | ||||
| -rw-r--r-- | queries/tact/highlights.scm | 62 | ||||
| -rw-r--r-- | queries/tact/indents.scm | 2 | ||||
| -rw-r--r-- | queries/tact/locals.scm | 2 |
4 files changed, 61 insertions, 9 deletions
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 ; ----------------------------- |
