feat: add capnp (#4203)

This commit is contained in:
Amaan Qureshi 2023-01-23 03:00:32 -05:00 committed by GitHub
parent 1913ce2fd2
commit 6cf93175bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 137 additions and 0 deletions

View file

@ -182,6 +182,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [bibtex](https://github.com/latex-lsp/tree-sitter-bibtex) (maintained by @theHamsta, @clason)
- [x] [blueprint](https://gitlab.com/gabmus/tree-sitter-blueprint.git) (experimental, maintained by @gabmus)
- [x] [c](https://github.com/tree-sitter/tree-sitter-c) (maintained by @vigoux)
- [x] [capnp](https://github.com/amaanq/tree-sitter-capnp) (experimental, maintained by @amaanq)
- [x] [c_sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) (maintained by @Luxed)
- [x] [clojure](https://github.com/sogaiu/tree-sitter-clojure) (maintained by @sogaiu)
- [x] [cmake](https://github.com/uyha/tree-sitter-cmake) (maintained by @uyha)

View file

@ -29,6 +29,9 @@
"c": {
"revision": "7175a6dd5fc1cee660dce6fe23f6043d75af424a"
},
"capnp": {
"revision": "fda654c12f29ec70309d9573bc0af16b7124384e"
},
"c_sharp": {
"revision": "a29bac0681802139710b4d3875540901504d15cb"
},

View file

@ -1195,6 +1195,15 @@ list.astro = {
maintainers = { "@virchau13" },
}
list.capnp = {
install_info = {
url = "https://github.com/amaanq/tree-sitter-capnp",
files = { "src/parser.c" },
},
maintainers = { "@amaanq" },
experimental = true,
}
list.wgsl = {
install_info = {
url = "https://github.com/szebniok/tree-sitter-wgsl",

View file

@ -0,0 +1,124 @@
; Preproc (?)
(unique_id) @preproc
; Includes
[
"import"
"$import"
"embed"
] @include
(import_path) @string
; Types
(primitive_type) @type.builtin
[
"annotation"
"enum"
"group"
"interface"
"List"
"struct"
"union"
] @type.builtin
; Typedefs
(type_definition) @type.definition
; Labels (@number, @number!)
(field_version) @label
; Methods
(method_identifier) @method
; Fields
(field_identifier) @field
; Parameters
(param_identifier) @parameter
(return_identifier) @parameter
; Variables
(identifier) @variable
; Constants
(const_identifier) @constant
(enum_member) @constant
; Types
(enum_identifier) @type
(extend_type) @type
(field_type) @type
(generic_identifier) @type
(type_identifier) @type
; Attributes
(attribute) @attribute
(annotation_identifier) @attribute
; Operators
[
; @ ! -
"="
] @operator
; Keywords
[
"extends"
"namespace"
"using"
] @keyword
; Literals
(string_literal) @string
(data_string) @string.special
(namespace) @string.special
(number) @number
(float) @float
(boolean) @boolean
; Misc
[
"const"
] @type.qualifier
[
"*"
] @punctuation.special
["{" "}"] @punctuation.bracket
["(" ")"] @punctuation.bracket
["[" "]"] @punctuation.bracket
[
","
";"
"->"
] @punctuation.delimiter
; Comments
(comment) @comment @spell