aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUy Ha <hchanuy@gmail.com>2022-12-05 23:17:19 +0100
committerStephan Seitz <stephan.seitz@fau.de>2022-12-13 21:17:48 +0100
commitd1f8e102e5c9961b535a7e1450b47c3bf233fe32 (patch)
tree08ce13fef251c3e5ddceec17b9792a059fe3a5fb
parentfeat(cmake): add block_def to fold (diff)
downloadnvim-treesitter-d1f8e102e5c9961b535a7e1450b47c3bf233fe32.tar
nvim-treesitter-d1f8e102e5c9961b535a7e1450b47c3bf233fe32.tar.gz
nvim-treesitter-d1f8e102e5c9961b535a7e1450b47c3bf233fe32.tar.bz2
nvim-treesitter-d1f8e102e5c9961b535a7e1450b47c3bf233fe32.tar.lz
nvim-treesitter-d1f8e102e5c9961b535a7e1450b47c3bf233fe32.tar.xz
nvim-treesitter-d1f8e102e5c9961b535a7e1450b47c3bf233fe32.tar.zst
nvim-treesitter-d1f8e102e5c9961b535a7e1450b47c3bf233fe32.zip
add queries for block, return, break, continue, and include
-rw-r--r--queries/cmake/highlights.scm37
1 files changed, 35 insertions, 2 deletions
diff --git a/queries/cmake/highlights.scm b/queries/cmake/highlights.scm
index 3378480c0..76dab232d 100644
--- a/queries/cmake/highlights.scm
+++ b/queries/cmake/highlights.scm
@@ -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)