mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
add queries for block, return, break, continue, and include
This commit is contained in:
parent
134d5bee6e
commit
d1f8e102e5
1 changed files with 35 additions and 2 deletions
|
|
@ -38,6 +38,15 @@
|
|||
(endwhile)
|
||||
] @repeat
|
||||
|
||||
(normal_command
|
||||
(identifier) @repeat
|
||||
(#match? @repeat "\\c^(continue|break)$")
|
||||
)
|
||||
(normal_command
|
||||
(identifier) @keyword.return
|
||||
(#match? @keyword.return "\\c^return$")
|
||||
)
|
||||
|
||||
(function_command
|
||||
(function)
|
||||
. (argument) @function
|
||||
|
|
@ -50,6 +59,15 @@
|
|||
(argument)* @parameter
|
||||
)
|
||||
|
||||
(block_def
|
||||
(block_command
|
||||
(block) @function.builtin
|
||||
(argument (unquoted_argument) @constant)
|
||||
(#any-of? @constant "SCOPE_FOR" "POLICIES" "VARIABLES" "PROPAGATE")
|
||||
)
|
||||
(endblock_command (endblock) @function.builtin)
|
||||
)
|
||||
|
||||
(normal_command
|
||||
(identifier) @function.builtin
|
||||
. (argument) @variable
|
||||
|
|
@ -70,9 +88,9 @@
|
|||
(#match? @function.builtin "\\c^(set)$")
|
||||
. (argument)
|
||||
(
|
||||
(argument) @_cache @constant
|
||||
(argument) @_cache @storageclass
|
||||
.
|
||||
(argument) @_type @constant
|
||||
(argument) @_type @type
|
||||
(#any-of? @_cache "CACHE")
|
||||
(#any-of? @_type "BOOL" "FILEPATH" "PATH" "STRING" "INTERNAL")
|
||||
)
|
||||
|
|
@ -123,6 +141,21 @@
|
|||
(#match? @function.builtin "\\c^(add_custom_command)$")
|
||||
)
|
||||
|
||||
(normal_command
|
||||
(identifier) @function.builtin
|
||||
(#match? @function.builtin "\\c^include$")
|
||||
(argument) @constant
|
||||
(#any-of? @constant "OPTIONAL" "NO_POLICY_SCOPE")
|
||||
)
|
||||
(normal_command
|
||||
(identifier) @function.builtin
|
||||
(#match? @function.builtin "\\c^include$")
|
||||
(argument) @constant
|
||||
.
|
||||
(argument) @variable
|
||||
(#match? @constant "RESULT_VARIABLE")
|
||||
)
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
((source_file . (line_comment) @preproc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue