feat: add thrift (#4185)

This commit is contained in:
Amaan Qureshi 2023-01-21 07:39:15 -05:00 committed by GitHub
parent 341bbae864
commit 08e1adae53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 157 additions and 0 deletions

View file

@ -299,6 +299,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [sxhkdrc](https://github.com/RaafatTurki/tree-sitter-sxhkdrc) (maintained by @RaafatTurki)
- [x] [teal](https://github.com/euclidianAce/tree-sitter-teal) (maintained by @euclidianAce)
- [x] [terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) (maintained by @MichaHoffmann)
- [x] [thrift](https://github.com/duskmoon314/tree-sitter-thrift) (maintained by @amaanq, @duskmoon314)
- [x] [tiger](https://github.com/ambroisie/tree-sitter-tiger) (maintained by @ambroisie)
- [x] [tlaplus](https://github.com/tlaplus-community/tree-sitter-tlaplus) (maintained by @ahelwer, @susliko)
- [x] [todotxt](https://github.com/arnarg/tree-sitter-todotxt.git) (experimental, maintained by @arnarg)

View file

@ -386,6 +386,9 @@
"terraform": {
"revision": "0ff887f2a60a147452d52db060de6b42f42f1441"
},
"thrift": {
"revision": "b49105758e3375f7f20781ba617493c1aac7d3c9"
},
"tiger": {
"revision": "a233ebe360a73a92c50978e5c4e9e471bc59ff42"
},

View file

@ -1244,6 +1244,15 @@ list.v = {
maintainers = { "@kkharji" },
}
list.thrift = {
install_info = {
url = "https://github.com/duskmoon314/tree-sitter-thrift",
files = { "src/parser.c" },
},
maintainers = { "@amaanq", "@duskmoon314" },
experimental = true,
}
list.tiger = {
install_info = {
url = "https://github.com/ambroisie/tree-sitter-tiger",

View file

@ -0,0 +1,144 @@
; Namespace
(namespace) @namespace
; Includes
[
"include"
"cpp_include"
] @include
(include_path) @string
; Types
(primitive_type) @type.builtin
[
"list"
"map"
"set"
] @type.builtin
; Function
(function) @function
; Fields
(field) @field
; Parameters
(parameter) @parameter
; Variables
(identifier) @variable
; Operators
[
"="
"+"
"-"
"&"
] @operator
; Exceptions
[
(exception)
(throws)
] @exception
; Keywords
[
"const"
"cpp_include"
"enum"
"exception"
"extends"
"include"
"namespace"
"oneway"
"optional"
"required"
"senum"
"service"
"struct"
"throws"
"typedef"
"union"
"void"
] @keyword
; Deprecated
[
"async"
"byte"
"cocoa_prefix"
"cpp_namespace"
"csharp_namespace"
"delphi_namespace"
"java_package"
"perl_package"
"php_namespace"
"py_module"
"ruby_namespace"
"smalltalk_category"
"smalltalk_prefix"
"xsd_all"
"xsd_attrs"
"xsd_namespace"
"xsd_nillable"
"xsd_optional"
] @keyword
(namespace_scope) @keyword
; Literals
(string_literal) @string
(number) @number
(double) @float
(boolean) @boolean
(typedef_definition) @type.definition
[
"const"
] @type.qualifier
[
"*"
] @punctuation.special
; Misc
(field_modifier) @attribute
["{" "}"] @punctuation.bracket
["(" ")"] @punctuation.bracket
["[" "]"] @punctuation.bracket
[
";"
","
(list_separator)
] @punctuation.delimiter
; Errors
(invalid) @error
; Comments
(comment) @comment @spell