mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 09:20:04 -04:00
highlights: use @preproc where appropriate
This commit is contained in:
parent
0bfeb5484e
commit
9b43ab819c
15 changed files with 43 additions and 16 deletions
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
;; Pragmas and comments
|
;; Pragmas and comments
|
||||||
|
|
||||||
(pragma) @constant.macro
|
(pragma) @preproc
|
||||||
|
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,3 +131,6 @@
|
||||||
value: (word) @parameter)
|
value: (word) @parameter)
|
||||||
|
|
||||||
(regex) @string.regex
|
(regex) @string.regex
|
||||||
|
|
||||||
|
((program . (comment) @preproc)
|
||||||
|
(#match? @preproc "^#!/"))
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
"#elif"
|
"#elif"
|
||||||
"#endif"
|
"#endif"
|
||||||
(preproc_directive)
|
(preproc_directive)
|
||||||
] @keyword
|
] @preproc
|
||||||
|
|
||||||
"#include" @include
|
"#include" @include
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -124,3 +124,6 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
(escape_sequence) @string.escape
|
(escape_sequence) @string.escape
|
||||||
|
|
||||||
|
((source_file . (line_comment) @preproc)
|
||||||
|
(#match? @preproc "^#!/"))
|
||||||
|
|
|
||||||
|
|
@ -46,10 +46,9 @@
|
||||||
(identifier) @constant)
|
(identifier) @constant)
|
||||||
)
|
)
|
||||||
|
|
||||||
[
|
(comment) @comment
|
||||||
(comment)
|
|
||||||
(preproc)
|
(preproc) @preproc
|
||||||
] @comment
|
|
||||||
|
|
||||||
(comment) @spell
|
(comment) @spell
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,10 +112,9 @@
|
||||||
(undefined)
|
(undefined)
|
||||||
] @constant.builtin
|
] @constant.builtin
|
||||||
|
|
||||||
[
|
(comment) @comment
|
||||||
(comment)
|
|
||||||
(hash_bang_line)
|
(hash_bang_line) @preproc
|
||||||
] @comment
|
|
||||||
|
|
||||||
(comment) @spell
|
(comment) @spell
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,9 @@
|
||||||
((word) @boolean
|
((word) @boolean
|
||||||
(#any-of? @boolean "true" "false"))
|
(#any-of? @boolean "true" "false"))
|
||||||
|
|
||||||
|
((program . (comment) @preproc)
|
||||||
|
(#match? @preproc "^#!/"))
|
||||||
|
|
||||||
;; Error
|
;; Error
|
||||||
|
|
||||||
(ERROR) @error
|
(ERROR) @error
|
||||||
|
|
|
||||||
|
|
@ -207,10 +207,9 @@
|
||||||
|
|
||||||
;;; Literals
|
;;; Literals
|
||||||
|
|
||||||
[
|
(comment) @comment
|
||||||
(comment)
|
|
||||||
(shebang_line)
|
(shebang_line) @preproc
|
||||||
] @comment
|
|
||||||
|
|
||||||
(comment) @spell
|
(comment) @spell
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,9 @@
|
||||||
(comment_environment)
|
(comment_environment)
|
||||||
] @comment
|
] @comment
|
||||||
|
|
||||||
|
((line_comment) @preproc
|
||||||
|
(#lua-match? @preproc "^%% !TeX"))
|
||||||
|
|
||||||
[
|
[
|
||||||
(brack_group)
|
(brack_group)
|
||||||
(brack_group_argc)
|
(brack_group_argc)
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@
|
||||||
|
|
||||||
(comment) @comment @spell
|
(comment) @comment @spell
|
||||||
|
|
||||||
(hash_bang_line) @comment
|
(hash_bang_line) @preproc
|
||||||
|
|
||||||
(number) @number
|
(number) @number
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,9 @@
|
||||||
(comments) @comment
|
(comments) @comment
|
||||||
(comments) @spell
|
(comments) @spell
|
||||||
|
|
||||||
|
((source_file . (comments) @preproc)
|
||||||
|
(#match? @preproc "^#!/"))
|
||||||
|
|
||||||
; POD should be handled specially with its own embedded subtype but for now
|
; POD should be handled specially with its own embedded subtype but for now
|
||||||
; we'll just have to do this.
|
; we'll just have to do this.
|
||||||
(pod_statement) @text
|
(pod_statement) @text
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,10 @@
|
||||||
(float) @float
|
(float) @float
|
||||||
|
|
||||||
(comment) @comment @spell
|
(comment) @comment @spell
|
||||||
|
|
||||||
|
((module . (comment) @preproc)
|
||||||
|
(#match? @preproc "^#!/"))
|
||||||
|
|
||||||
(string) @string
|
(string) @string
|
||||||
[
|
[
|
||||||
(escape_sequence)
|
(escape_sequence)
|
||||||
|
|
|
||||||
|
|
@ -29,3 +29,6 @@
|
||||||
|
|
||||||
((program . (comment) @include)
|
((program . (comment) @include)
|
||||||
(#match? @include "^;\ +inherits\ *:"))
|
(#match? @include "^;\ +inherits\ *:"))
|
||||||
|
|
||||||
|
((program . (comment) @preproc)
|
||||||
|
(#match? @preproc "^; +extends"))
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,9 @@
|
||||||
|
|
||||||
(comment) @comment @spell
|
(comment) @comment @spell
|
||||||
|
|
||||||
|
((program . (comment) @preproc)
|
||||||
|
(#match? @preproc "^#!/"))
|
||||||
|
|
||||||
(identifier) @variable
|
(identifier) @variable
|
||||||
|
|
||||||
(formal_parameters (identifier) @parameter)
|
(formal_parameters (identifier) @parameter)
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,14 @@
|
||||||
(anchor_name) @type
|
(anchor_name) @type
|
||||||
(alias_name) @type
|
(alias_name) @type
|
||||||
(tag) @type
|
(tag) @type
|
||||||
(yaml_directive) @keyword
|
|
||||||
(ERROR) @error
|
(ERROR) @error
|
||||||
|
|
||||||
|
[
|
||||||
|
(yaml_directive)
|
||||||
|
(tag_directive)
|
||||||
|
(reserved_directive)
|
||||||
|
] @preproc
|
||||||
|
|
||||||
(block_mapping_pair
|
(block_mapping_pair
|
||||||
key: (flow_node [(double_quote_scalar) (single_quote_scalar)] @field))
|
key: (flow_node [(double_quote_scalar) (single_quote_scalar)] @field))
|
||||||
(block_mapping_pair
|
(block_mapping_pair
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue