feat: add properties parser

This commit is contained in:
ObserverOfTime 2023-11-21 02:19:07 +02:00
parent 670e7aa843
commit 6b24db0c8f
6 changed files with 46 additions and 0 deletions

View file

@ -0,0 +1,28 @@
(comment) @comment @spell
(key) @property
(value) @string
(value (escape) @string.escape)
((value) @boolean
(#any-of? @boolean "true" "false"))
((value) @number
(#lua-match? @number "^%d+$"))
(index) @number
(property [ "=" ":" ] @operator)
[ "${" "}" ] @punctuation.special
(substitution ":" @punctuation.special)
[ "[" "]" ] @punctuation.bracket
[ "." "\\" ] @punctuation.delimiter
((substitution (key) @constant)
(#lua-match? @constant "^[A-Z_][A-Z0-9_]*$"))

View file

@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))

View file

@ -0,0 +1,3 @@
(property (key) @definition)
(substitution (key) @reference)