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