highlights(zig): highlight enum,union,error and custom number type

* highlight enum field as a constant
 * highlight cImport and constructor
 * highlight else_switch

enum constant
This commit is contained in:
maxxnino 2021-07-29 19:10:38 +09:00 committed by Stephan Seitz
parent bbc96c9515
commit 357a91375d

View file

@ -27,13 +27,19 @@
(build_in_call_expr (build_in_call_expr
function: ((identifier) @include function: ((identifier) @include
(#eq? @include "@import")) (#any-of? @include "@import" "@cImport"))
)
(struct_construction
(type_identifier) @constructor
) )
;; other identifiers ;; other identifiers
(type_identifier) @type (type_identifier) @type
(custom_number_type) @type.builtin
(primitive_type) @type.builtin (primitive_type) @type.builtin
(field_identifier) @field (field_identifier) @field
(enum_identifier) @constant
(union_identifier) @field
(error_identifier) @field
(line_comment) @comment (line_comment) @comment
(doc_comment) @comment (doc_comment) @comment
@ -121,6 +127,7 @@
"fn" @keyword.function "fn" @keyword.function
[ [
(else_switch)
"continue" "continue"
"else" "else"
"if" "if"