diff options
| author | Tomas Sandven <tomas@sandven.email> | 2021-07-23 17:41:24 +0200 |
|---|---|---|
| committer | Stephan Seitz <stephan.lauf@yahoo.de> | 2021-07-23 17:56:45 +0200 |
| commit | 65a059b34d5bc77db01372c589f582b17524a2f9 (patch) | |
| tree | 797467857ce1e3d73cbd2c8314e749bf7b848d5a /queries/yang | |
| parent | 05423e75c5229edfd619f3e654851e0073e59d19 (diff) | |
Update YANG parser revision and highlights query
Diffstat (limited to 'queries/yang')
| -rw-r--r-- | queries/yang/highlights.scm | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/queries/yang/highlights.scm b/queries/yang/highlights.scm index 82ae8d5b..8c3569e8 100644 --- a/queries/yang/highlights.scm +++ b/queries/yang/highlights.scm @@ -6,24 +6,35 @@ ; Keywords (statement_keyword) @keyword -(extension_keyword) @string.escape +(statement_keyword "import") @include +(extension_keyword) @function ; Arguments (built_in_type) @type.builtin -(integer) @number +(number) @number (boolean) @boolean (date) @number -(range) @string.escape -(unquoted_range) @string.escape -(yang_version) @string.escape +(range (_ ".." @punctuation.special)) +(range (_ "|" @punctuation.special)) +(quoted_range "\"" @string.special) +(quoted_range "'" @string.special) +(yang_version) @constant.builtin (identifier) @variable (node_identifier) @variable -(glob) @string (string) @string +(string (escape_sequence) @string.escape) (unquoted_string) @string -(keypath) @string.escape +(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 + (statement_keyword ["pattern" "must"]) + (argument (string) @string.special)) ; Punctuation -(plus_symbol) @punctuation.delimiter +(plus_symbol) @operator ["{" "}"] @punctuation.bracket [";"] @punctuation.delimiter |
