add queries for block, return, break, continue, and include

This commit is contained in:
Uy Ha 2022-12-05 23:17:19 +01:00 committed by Stephan Seitz
parent 134d5bee6e
commit d1f8e102e5

View file

@ -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)