highlights: use @preproc where appropriate

This commit is contained in:
ObserverOfTime 2022-09-18 20:15:23 +03:00 committed by Stephan Seitz
parent 0bfeb5484e
commit 9b43ab819c
15 changed files with 43 additions and 16 deletions

View file

@ -33,7 +33,7 @@
;; Pragmas and comments ;; Pragmas and comments
(pragma) @constant.macro (pragma) @preproc
(comment) @comment (comment) @comment

View file

@ -131,3 +131,6 @@
value: (word) @parameter) value: (word) @parameter)
(regex) @string.regex (regex) @string.regex
((program . (comment) @preproc)
(#match? @preproc "^#!/"))

View file

@ -43,7 +43,7 @@
"#elif" "#elif"
"#endif" "#endif"
(preproc_directive) (preproc_directive)
] @keyword ] @preproc
"#include" @include "#include" @include

View file

@ -124,3 +124,6 @@
) )
(escape_sequence) @string.escape (escape_sequence) @string.escape
((source_file . (line_comment) @preproc)
(#match? @preproc "^#!/"))

View file

@ -46,10 +46,9 @@
(identifier) @constant) (identifier) @constant)
) )
[ (comment) @comment
(comment)
(preproc) (preproc) @preproc
] @comment
(comment) @spell (comment) @spell

View file

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

View file

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

View file

@ -207,10 +207,9 @@
;;; Literals ;;; Literals
[ (comment) @comment
(comment)
(shebang_line) (shebang_line) @preproc
] @comment
(comment) @spell (comment) @spell

View file

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

View file

@ -182,7 +182,7 @@
(comment) @comment @spell (comment) @comment @spell
(hash_bang_line) @comment (hash_bang_line) @preproc
(number) @number (number) @number

View file

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

View file

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

View file

@ -29,3 +29,6 @@
((program . (comment) @include) ((program . (comment) @include)
(#match? @include "^;\ +inherits\ *:")) (#match? @include "^;\ +inherits\ *:"))
((program . (comment) @preproc)
(#match? @preproc "^; +extends"))

View file

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

View file

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