diff options
| author | Novus Nota <68142933+novusnota@users.noreply.github.com> | 2024-10-09 09:21:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-09 09:21:33 +0200 |
| commit | 9d2acd49976e2a9da72949008df03436f781fd23 (patch) | |
| tree | aa42ee59be510a4d6072120d7756e2741d70eb6a /queries/tact | |
| parent | bot(lockfile): update superhtml, v (diff) | |
| download | nvim-treesitter-9d2acd49976e2a9da72949008df03436f781fd23.tar nvim-treesitter-9d2acd49976e2a9da72949008df03436f781fd23.tar.gz nvim-treesitter-9d2acd49976e2a9da72949008df03436f781fd23.tar.bz2 nvim-treesitter-9d2acd49976e2a9da72949008df03436f781fd23.tar.lz nvim-treesitter-9d2acd49976e2a9da72949008df03436f781fd23.tar.xz nvim-treesitter-9d2acd49976e2a9da72949008df03436f781fd23.tar.zst nvim-treesitter-9d2acd49976e2a9da72949008df03436f781fd23.zip | |
feat(tact): update parser and queries (#7196)
Diffstat (limited to 'queries/tact')
| -rw-r--r-- | queries/tact/folds.scm | 2 | ||||
| -rw-r--r-- | queries/tact/highlights.scm | 29 | ||||
| -rw-r--r-- | queries/tact/indents.scm | 2 | ||||
| -rw-r--r-- | queries/tact/locals.scm | 8 |
4 files changed, 22 insertions, 19 deletions
diff --git a/queries/tact/folds.scm b/queries/tact/folds.scm index 03713dd7c..66e7bdaa9 100644 --- a/queries/tact/folds.scm +++ b/queries/tact/folds.scm @@ -13,4 +13,6 @@ (trait_body) (function_body) (block_statement) + (asm_function_body) + (asm_list) ] @fold diff --git a/queries/tact/highlights.scm b/queries/tact/highlights.scm index 13afd9a3c..d65b501cf 100644 --- a/queries/tact/highlights.scm +++ b/queries/tact/highlights.scm @@ -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 ; --------- [ diff --git a/queries/tact/indents.scm b/queries/tact/indents.scm index 749ab2469..b26ce1460 100644 --- a/queries/tact/indents.scm +++ b/queries/tact/indents.scm @@ -13,6 +13,8 @@ (trait_body) (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 d580d6a7e..042afb941 100644 --- a/queries/tact/locals.scm +++ b/queries/tact/locals.scm @@ -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)) |
