mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
simplify cmake highlight queries
This commit is contained in:
parent
a9f0b1c2ba
commit
cf718048ca
1 changed files with 2 additions and 136 deletions
|
|
@ -97,143 +97,9 @@
|
|||
)
|
||||
|
||||
(normal_command
|
||||
(identifier) @_function
|
||||
(#match? @_function "\\c^set$")
|
||||
(
|
||||
(argument) @constant
|
||||
(#any-of? @constant "PARENT_SCOPE")
|
||||
) .
|
||||
)
|
||||
|
||||
(normal_command
|
||||
(identifier) @_function
|
||||
(#match? @_function "\\c^set$")
|
||||
. (argument)
|
||||
(
|
||||
(argument) @_cache @storageclass
|
||||
.
|
||||
(argument) @_type @type
|
||||
(#any-of? @_cache "CACHE")
|
||||
(#any-of? @_type "BOOL" "FILEPATH" "PATH" "STRING" "INTERNAL")
|
||||
)
|
||||
)
|
||||
(normal_command
|
||||
(identifier) @_function
|
||||
(#match? @_function "\\c^set$")
|
||||
. (argument)
|
||||
(argument) @_cache
|
||||
(#any-of? @_cache "CACHE")
|
||||
(
|
||||
(argument) @_force @constant
|
||||
(#any-of? @_force "FORCE")
|
||||
) .
|
||||
)
|
||||
|
||||
(normal_command
|
||||
(identifier) @_function
|
||||
(#match? @_function "\\c^unset$")
|
||||
. (argument) @variable
|
||||
)
|
||||
(normal_command
|
||||
(identifier) @_function
|
||||
(#match? @_function "\\c^unset$")
|
||||
. (argument)
|
||||
(argument) @storageclass
|
||||
(#any-of? @storageclass "CACHE" "PARENT_SCOPE")
|
||||
)
|
||||
|
||||
(normal_command
|
||||
(identifier) @_function
|
||||
(#match? @_function "\\c^list$")
|
||||
. (argument) @constant
|
||||
(#any-of? @constant "LENGTH" "GET" "JOIN" "SUBLIST" "FIND")
|
||||
. (argument) @variable
|
||||
(argument) @variable .
|
||||
)
|
||||
(normal_command
|
||||
(identifier) @_function
|
||||
(#match? @_function "\\c^list$")
|
||||
. (argument) @constant
|
||||
. (argument) @variable
|
||||
(#any-of? @constant "APPEND" "FILTER" "INSERT"
|
||||
"POP_BACK" "POP_FRONT" "PREPEND"
|
||||
"REMOVE_ITEM" "REMOVE_AT" "REMOVE_DUPLICATES"
|
||||
"REVERSE" "SORT")
|
||||
)
|
||||
(normal_command
|
||||
(identifier) @_function
|
||||
(#match? @_function "\\c^list$")
|
||||
. (argument) @_transform @constant
|
||||
. (argument) @variable
|
||||
. (argument) @_action @constant
|
||||
(#match? @_transform "TRANSFORM")
|
||||
(#any-of? @_action "APPEND" "PREPEND" "TOUPPER" "TOLOWER" "STRIP" "GENEX_STRIP" "REPLACE")
|
||||
)
|
||||
(normal_command
|
||||
(identifier) @_function
|
||||
(#match? @_function "\\c^list$")
|
||||
. (argument) @_transform @constant
|
||||
. (argument) @variable
|
||||
. (argument) @_action @constant
|
||||
. (argument)? @_selector @constant
|
||||
(#match? @_transform "TRANSFORM")
|
||||
(#any-of? @_action "APPEND" "PREPEND" "TOUPPER" "TOLOWER" "STRIP" "GENEX_STRIP" "REPLACE")
|
||||
(#any-of? @_selector "AT" "FOR" "REGEX")
|
||||
)
|
||||
(normal_command
|
||||
(identifier) @_function
|
||||
(#match? @_function "\\c^list$")
|
||||
. (argument) @_transform @constant
|
||||
(argument) @constant .
|
||||
(argument) @variable
|
||||
(#match? @_transform "TRANSFORM")
|
||||
(#match? @constant "OUTPUT_VARIABLE")
|
||||
)
|
||||
|
||||
(normal_command
|
||||
(identifier) @_function
|
||||
(#match? @_function "\\c^add_custom_target$")
|
||||
. (argument)
|
||||
(identifier)
|
||||
(argument) @constant
|
||||
(#any-of? @constant "ALL" "COMMAND" "DEPENDS" "BYPRODUCTS" "WORKING_DIRECTORY" "COMMENT"
|
||||
"JOB_POOL" "VERBATIM" "USES_TERMINAL" "COMMAND_EXPAND_LISTS" "SOURCES")
|
||||
)
|
||||
|
||||
(normal_command
|
||||
(identifier) @_function
|
||||
(#match? @_function "\\c^add_custom_command$")
|
||||
(argument) @constant
|
||||
(#any-of? @constant "OUTPUT" "COMMAND" "MAIN_DEPENDENCY" "DEPENDS" "BYPRODUCTS" "IMPLICIT_DEPENDS" "WORKING_DIRECTORY"
|
||||
"COMMENT" "DEPFILE" "JOB_POOL" "VERBATIM" "APPEND" "USES_TERMINAL" "COMMAND_EXPAND_LISTS")
|
||||
)
|
||||
|
||||
(normal_command
|
||||
(identifier) @_function
|
||||
(#match? @_function "\\c^include$")
|
||||
(argument) @constant
|
||||
(#any-of? @constant "OPTIONAL" "NO_POLICY_SCOPE")
|
||||
)
|
||||
(normal_command
|
||||
(identifier) @_function
|
||||
(#match? @_function "\\c^include$")
|
||||
(argument) @constant
|
||||
.
|
||||
(argument) @variable
|
||||
(#match? @constant "RESULT_VARIABLE")
|
||||
)
|
||||
|
||||
(normal_command
|
||||
(identifier) @_function
|
||||
(#match? @_function "\\c^project$")
|
||||
(argument) @constant
|
||||
(#any-of? @constant "VERSION" "DESCRIPTION" "HOMEPAGE_URL" "LANGUAGES")
|
||||
)
|
||||
|
||||
(normal_command
|
||||
(identifier) @_function
|
||||
(#match? @_function "\\c^cmake_minimum_required$")
|
||||
(argument) @constant
|
||||
(#any-of? @constant "VERSION" "FATAL_ERROR")
|
||||
(#match? @constant "^[A-Z][A-Z_]+$")
|
||||
)
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue