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

@ -328,6 +328,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [pony](https://github.com/amaanq/tree-sitter-pony) (maintained by @amaanq, @mfelsche)
- [x] [prisma](https://github.com/victorhqc/tree-sitter-prisma) (maintained by @elianiva)
- [x] [promql](https://github.com/MichaHoffmann/tree-sitter-promql) (maintained by @MichaHoffmann)
- [x] [properties](https://github.com/ObserverOfTime/tree-sitter-properties) (maintained by @ObserverOfTime)
- [x] [proto](https://github.com/treywood/tree-sitter-proto) (maintained by @treywood)
- [x] [prql](https://github.com/PRQL/tree-sitter-prql) (maintained by @matthias-Q)
- [x] [psv](https://github.com/amaanq/tree-sitter-csv) (maintained by @amaanq)

View file

@ -464,6 +464,9 @@
"promql": {
"revision": "77625d78eebc3ffc44d114a07b2f348dff3061b0"
},
"properties": {
"revision": "97253273bdf8b63546c8006e71ba155ecc27069e"
},
"proto": {
"revision": "e9f6b43f6844bd2189b50a422d4e2094313f6aa3"
},

View file

@ -1385,6 +1385,15 @@ list.promql = {
maintainers = { "@MichaHoffmann" },
}
list.properties = {
install_info = {
url = "https://github.com/ObserverOfTime/tree-sitter-properties",
files = { "src/parser.c" },
},
filetype = "jproperties",
maintainers = { "@ObserverOfTime" },
}
list.proto = {
install_info = {
url = "https://github.com/treywood/tree-sitter-proto",

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)