summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Sandven <tomas@sandven.email>2021-07-23 17:41:24 +0200
committerStephan Seitz <stephan.lauf@yahoo.de>2021-07-23 17:56:45 +0200
commit65a059b34d5bc77db01372c589f582b17524a2f9 (patch)
tree797467857ce1e3d73cbd2c8314e749bf7b848d5a
parent05423e75c5229edfd619f3e654851e0073e59d19 (diff)
Update YANG parser revision and highlights query
-rw-r--r--lockfile.json2
-rw-r--r--queries/yang/highlights.scm27
2 files changed, 20 insertions, 9 deletions
diff --git a/lockfile.json b/lockfile.json
index 92e082b9..eaf11fd1 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -198,7 +198,7 @@
"revision": "0e36bed171768908f331ff7dff9d956bae016efb"
},
"yang": {
- "revision": "887204bbaff4e95bb13543d2544ebec609249d32"
+ "revision": "eb4ace1fdc4954d7e4f0687c687219f78a6ce64e"
},
"zig": {
"revision": "05d6f44e5ae8fe986a7ca09ce2a301aa5148a20f"
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