mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
feat(runescript): add parser and queries (#7305)
This commit is contained in:
parent
4b9a83f601
commit
7c5a4632c4
4 changed files with 133 additions and 0 deletions
|
|
@ -671,6 +671,9 @@
|
||||||
"ruby": {
|
"ruby": {
|
||||||
"revision": "557ec01403bd1fcfea50f1805641ca773cbaaa42"
|
"revision": "557ec01403bd1fcfea50f1805641ca773cbaaa42"
|
||||||
},
|
},
|
||||||
|
"runescript": {
|
||||||
|
"revision": "e0568a271a1901b8ef87367bbf282b5c639cd742"
|
||||||
|
},
|
||||||
"rust": {
|
"rust": {
|
||||||
"revision": "2ace7a922a755960f44d73a7bb1efffeb4cc5501"
|
"revision": "2ace7a922a755960f44d73a7bb1efffeb4cc5501"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ for ft, lang in pairs {
|
||||||
mysql = "sql",
|
mysql = "sql",
|
||||||
sbt = "scala",
|
sbt = "scala",
|
||||||
neomuttrc = "muttrc",
|
neomuttrc = "muttrc",
|
||||||
|
clientscript = "runescript",
|
||||||
--- short-hand list from https://github.com/helix-editor/helix/blob/master/languages.toml
|
--- short-hand list from https://github.com/helix-editor/helix/blob/master/languages.toml
|
||||||
rs = "rust",
|
rs = "rust",
|
||||||
ex = "elixir",
|
ex = "elixir",
|
||||||
|
|
@ -1948,6 +1949,14 @@ list.ruby = {
|
||||||
maintainers = { "@TravonteD" },
|
maintainers = { "@TravonteD" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list.runescript = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/2004Scape/tree-sitter-runescript",
|
||||||
|
files = { "src/parser.c", "src/scanner.c" },
|
||||||
|
},
|
||||||
|
maintainers = { "@2004Scape" },
|
||||||
|
}
|
||||||
|
|
||||||
list.rust = {
|
list.rust = {
|
||||||
install_info = {
|
install_info = {
|
||||||
url = "https://github.com/tree-sitter/tree-sitter-rust",
|
url = "https://github.com/tree-sitter/tree-sitter-rust",
|
||||||
|
|
|
||||||
119
queries/runescript/highlights.scm
Normal file
119
queries/runescript/highlights.scm
Normal file
|
|
@ -0,0 +1,119 @@
|
||||||
|
; Variables
|
||||||
|
(identifier) @variable
|
||||||
|
|
||||||
|
(local_variable
|
||||||
|
"$" @attribute.builtin)
|
||||||
|
|
||||||
|
(game_variable
|
||||||
|
[
|
||||||
|
"%"
|
||||||
|
".%"
|
||||||
|
] @attribute.builtin)
|
||||||
|
|
||||||
|
(constant_variable
|
||||||
|
"^" @attribute.builtin)
|
||||||
|
|
||||||
|
(parameter
|
||||||
|
(local_variable
|
||||||
|
name: (identifier) @variable.parameter))
|
||||||
|
|
||||||
|
; Scripts
|
||||||
|
(script
|
||||||
|
trigger: (identifier) @keyword.directive
|
||||||
|
subject: (identifier) @function)
|
||||||
|
|
||||||
|
; Calls
|
||||||
|
(call
|
||||||
|
[
|
||||||
|
"~"
|
||||||
|
"@"
|
||||||
|
]? @attribute.builtin
|
||||||
|
callee: (identifier) @function.call)
|
||||||
|
|
||||||
|
; Literals
|
||||||
|
((literal) @boolean
|
||||||
|
(#any-of? @boolean "true" "false"))
|
||||||
|
|
||||||
|
(literal
|
||||||
|
"null" @constant.builtin)
|
||||||
|
|
||||||
|
(integer_literal) @number
|
||||||
|
|
||||||
|
(coord_literal) @string.special
|
||||||
|
|
||||||
|
(comment) @comment @spell
|
||||||
|
|
||||||
|
[
|
||||||
|
(string_fragment)
|
||||||
|
"\""
|
||||||
|
] @string
|
||||||
|
|
||||||
|
(escape_sequence) @string.escape
|
||||||
|
|
||||||
|
(string_interpolation
|
||||||
|
[
|
||||||
|
"<"
|
||||||
|
">"
|
||||||
|
] @punctuation.special)
|
||||||
|
|
||||||
|
(string_tag) @punctuation.special
|
||||||
|
|
||||||
|
; Types
|
||||||
|
(type) @type
|
||||||
|
|
||||||
|
(parameter_type) @type
|
||||||
|
|
||||||
|
; Tokens
|
||||||
|
[
|
||||||
|
";"
|
||||||
|
":"
|
||||||
|
","
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
[
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
[
|
||||||
|
"["
|
||||||
|
"]"
|
||||||
|
] @punctuation.special
|
||||||
|
|
||||||
|
[
|
||||||
|
"*"
|
||||||
|
"/"
|
||||||
|
"+"
|
||||||
|
"-"
|
||||||
|
"&"
|
||||||
|
"|"
|
||||||
|
">"
|
||||||
|
">="
|
||||||
|
"<"
|
||||||
|
"<="
|
||||||
|
"="
|
||||||
|
"!"
|
||||||
|
] @operator
|
||||||
|
|
||||||
|
(arithmetic
|
||||||
|
"%" @operator)
|
||||||
|
|
||||||
|
[
|
||||||
|
(def_type_keyword)
|
||||||
|
(switch_type_keyword)
|
||||||
|
] @keyword.modifier
|
||||||
|
|
||||||
|
"return" @keyword.return
|
||||||
|
|
||||||
|
"while" @keyword.repeat
|
||||||
|
|
||||||
|
[
|
||||||
|
"default"
|
||||||
|
"if"
|
||||||
|
"else"
|
||||||
|
"case"
|
||||||
|
] @keyword.conditional
|
||||||
|
|
||||||
|
"calc" @keyword
|
||||||
2
queries/runescript/injections.scm
Normal file
2
queries/runescript/injections.scm
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
((comment) @injection.content
|
||||||
|
(#set! injection.language "comment"))
|
||||||
Loading…
Add table
Add a link
Reference in a new issue