nvim-treesitter/queries/yang/highlights.scm

44 lines
1 KiB
Scheme
Raw Normal View History

2021-07-19 07:44:03 +02:00
(comment) @comment
; Module / submodule
["module" "submodule"] @keyword
; Keywords
(statement_keyword) @keyword
(statement_keyword "import") @include
(extension_keyword) @function
2021-07-19 07:44:03 +02:00
; Arguments
(built_in_type) @type.builtin
(number) @number
2021-07-19 07:44:03 +02:00
(boolean) @boolean
(date) @number
(range (_ ".." @punctuation.special))
(range (_ "|" @punctuation.special))
(quoted_range "\"" @string.special)
(quoted_range "'" @string.special)
(yang_version) @constant.builtin
2021-07-19 07:44:03 +02:00
(identifier) @variable
(node_identifier) @variable
(string) @string
(string (escape_sequence) @string.escape)
2021-07-19 07:44:03 +02:00
(unquoted_string) @string
(keypath) @string.special
; Always highlight the value of an enum statement as a string
(enum_value) @string
; Highlight xpath and pattern strings differently from plain strings
(statement
2022-11-21 15:34:16 +02:00
(statement_keyword "must")
(argument (string) @string.special))
2022-11-21 15:34:16 +02:00
(statement
(statement_keyword "pattern")
(argument (string) @string.regex))
2021-07-19 07:44:03 +02:00
; Punctuation
(plus_symbol) @operator
2021-07-19 07:44:03 +02:00
["{" "}"] @punctuation.bracket
[";"] @punctuation.delimiter