feat: add cpon

This commit is contained in:
Amaan Qureshi 2023-02-23 18:44:10 -05:00 committed by Stephan Seitz
parent 853b1ab39a
commit c38646edf2
8 changed files with 93 additions and 0 deletions

View file

@ -191,6 +191,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [comment](https://github.com/stsewd/tree-sitter-comment) (maintained by @stsewd)
- [x] [commonlisp](https://github.com/theHamsta/tree-sitter-commonlisp) (maintained by @theHamsta)
- [x] [cooklang](https://github.com/addcninblue/tree-sitter-cooklang) (maintained by @addcninblue)
- [x] [cpon](https://github.com/amaanq/tree-sitter-cpon) (maintained by @amaanq)
- [x] [cpp](https://github.com/tree-sitter/tree-sitter-cpp) (maintained by @theHamsta)
- [x] [css](https://github.com/tree-sitter/tree-sitter-css) (maintained by @TravonteD)
- [x] [cuda](https://github.com/theHamsta/tree-sitter-cuda) (maintained by @theHamsta)

View file

@ -53,6 +53,9 @@
"cooklang": {
"revision": "5e113412aadb78955c27010daa4dbe1d202013cf"
},
"cpon": {
"revision": "b894a70f883d2cb7505b87a9d84a189fe8cd1982"
},
"cpp": {
"revision": "66262d3e76eb2046c76e6d661a6b72664bfb5819"
},

View file

@ -220,6 +220,14 @@ list.cooklang = {
maintainers = { "@addcninblue" },
}
list.cpon = {
install_info = {
url = "https://github.com/amaanq/tree-sitter-cpon",
files = { "src/parser.c" },
},
maintainers = { "@amaanq" },
}
list.cpp = {
install_info = {
url = "https://github.com/tree-sitter/tree-sitter-cpp",

5
queries/cpon/folds.scm Normal file
View file

@ -0,0 +1,5 @@
[
(meta_map)
(map)
(array)
] @fold

View file

@ -0,0 +1,45 @@
; Literals
(string) @string
(escape_sequence) @string.escape
(hex_blob
"x" @character.special
(_) @string)
(esc_blob
"b" @character.special
(_) @string)
(datetime
"d" @character.special
(_) @string.special)
(number) @number
(float) @float
(boolean) @boolean
(null) @constant.builtin
; Punctuation
[
","
":"
] @punctuation.delimiter
[ "{" "}" ] @punctuation.bracket
[ "[" "]" ] @punctuation.bracket
[ "<" ">" ] @punctuation.bracket
; Comments
(comment) @comment @spell
; Errors
(ERROR) @error

23
queries/cpon/indents.scm Normal file
View file

@ -0,0 +1,23 @@
[
(meta_map)
(map)
(imap)
(array)
] @indent
[
"]"
"}"
">"
] @indent_end
[ "{" "}" ] @branch
[ "[" "]" ] @branch
[ "<" ">" ] @branch
[
(ERROR)
(comment)
] @auto

View file

@ -0,0 +1 @@
(comment) @comment

7
queries/cpon/locals.scm Normal file
View file

@ -0,0 +1,7 @@
[
(document)
(meta_map)
(map)
(array)
] @scope