mirror of
https://github.com/nvim-treesitter/nvim-treesitter
synced 2024-09-16 14:34:05 +02:00
parent
121bf634fe
commit
512e2122e0
5 changed files with 151 additions and 0 deletions
|
@ -366,6 +366,7 @@ We are looking for maintainers to add more parsers and to write query files for
|
|||
- [x] [Tree-Sitter query language](https://github.com/nvim-treesitter/tree-sitter-query) (maintained by @steelsojka)
|
||||
- [x] [r](https://github.com/r-lib/tree-sitter-r) (maintained by @echasnovski)
|
||||
- [ ] [racket](https://github.com/6cdh/tree-sitter-racket)
|
||||
- [x] [ralph](https://github.com/alephium/tree-sitter-ralph) (maintained by @tdroxler)
|
||||
- [x] [rasi](https://github.com/Fymyte/tree-sitter-rasi) (maintained by @Fymyte)
|
||||
- [x] [rbs](https://github.com/joker1007/tree-sitter-rbs) (maintained by @joker1007)
|
||||
- [x] [re2c](https://github.com/amaanq/tree-sitter-re2c) (maintained by @amaanq)
|
||||
|
|
|
@ -578,6 +578,9 @@
|
|||
"racket": {
|
||||
"revision": "171f52a8c0ed635b85cd42d1e36d82f1066a03b4"
|
||||
},
|
||||
"ralph": {
|
||||
"revision": "48b9d9d6e2b55ce8f9eb09ceb0d952e4b1cc87a0"
|
||||
},
|
||||
"rasi": {
|
||||
"revision": "6c9bbcfdf5f0f553d9ebc01750a3aa247a37b8aa"
|
||||
},
|
||||
|
|
|
@ -1699,6 +1699,14 @@ list.racket = {
|
|||
},
|
||||
}
|
||||
|
||||
list.ralph = {
|
||||
install_info = {
|
||||
url = "https://github.com/alephium/tree-sitter-ralph",
|
||||
files = { "src/parser.c" },
|
||||
},
|
||||
maintainers = { "@tdroxler" },
|
||||
}
|
||||
|
||||
list.rasi = {
|
||||
install_info = {
|
||||
url = "https://github.com/Fymyte/tree-sitter-rasi",
|
||||
|
|
137
queries/ralph/highlights.scm
Normal file
137
queries/ralph/highlights.scm
Normal file
|
@ -0,0 +1,137 @@
|
|||
(type_identifier) @type
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
[
|
||||
(primitive_type)
|
||||
(alph_token_id)
|
||||
] @type.builtin
|
||||
|
||||
(var_declaration) @variable
|
||||
|
||||
(struct_field
|
||||
(identifier) @variable.member)
|
||||
|
||||
(arg_def
|
||||
(identifier) @variable.parameter)
|
||||
|
||||
(event_field
|
||||
(identifier) @variable.parameter)
|
||||
|
||||
(struct_constructor_field
|
||||
(identifier) @variable.parameter)
|
||||
|
||||
[
|
||||
(hex_num)
|
||||
(integer)
|
||||
(typed_num)
|
||||
] @number
|
||||
|
||||
[
|
||||
(bool)
|
||||
(bytes)
|
||||
(address)
|
||||
] @constant.builtin
|
||||
|
||||
(func_id
|
||||
[
|
||||
(identifier)
|
||||
"!"
|
||||
] @function)
|
||||
|
||||
(annotation
|
||||
[
|
||||
"@"
|
||||
(identifier)
|
||||
] @attribute)
|
||||
|
||||
(map_def
|
||||
(identifier) @variable.parameter)
|
||||
|
||||
"fn" @keyword.function
|
||||
|
||||
[
|
||||
"Contract"
|
||||
"TxScript"
|
||||
"Interface"
|
||||
"AssetScript"
|
||||
"struct"
|
||||
"enum"
|
||||
"event"
|
||||
"mapping"
|
||||
] @keyword.type
|
||||
|
||||
[
|
||||
"pub"
|
||||
"Abstract"
|
||||
(mutable)
|
||||
] @keyword.modifier
|
||||
|
||||
[
|
||||
"while"
|
||||
"for"
|
||||
] @keyword.repeat
|
||||
|
||||
"return" @keyword.return
|
||||
|
||||
[
|
||||
"if"
|
||||
"else"
|
||||
] @keyword.conditional
|
||||
|
||||
[
|
||||
"const"
|
||||
"let"
|
||||
"emit"
|
||||
"extends"
|
||||
"embeds"
|
||||
"implements"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
"."
|
||||
","
|
||||
":"
|
||||
";"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"="
|
||||
"->"
|
||||
(op_byte_vec_add)
|
||||
(op_add)
|
||||
(op_sub)
|
||||
(op_mul)
|
||||
(op_exp)
|
||||
(op_mod_exp)
|
||||
(op_div)
|
||||
(op_mod)
|
||||
(op_mod_add)
|
||||
(op_mod_sub)
|
||||
(op_mod_mul)
|
||||
(op_shl)
|
||||
(op_shr)
|
||||
(op_bit_and)
|
||||
(op_xor)
|
||||
(op_bit_or)
|
||||
(op_eq)
|
||||
(op_ne)
|
||||
(op_lt)
|
||||
(op_le)
|
||||
(op_gt)
|
||||
(op_ge)
|
||||
(op_and)
|
||||
(op_or)
|
||||
(op_not)
|
||||
] @operator
|
||||
|
||||
(line_comment) @comment @spell
|
2
queries/ralph/injections.scm
Normal file
2
queries/ralph/injections.scm
Normal file
|
@ -0,0 +1,2 @@
|
|||
((line_comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
Loading…
Reference in a new issue