aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaan Qureshi <amaanq12@gmail.com>2023-02-04 15:42:12 -0500
committerStephan Seitz <stephan.seitz@fau.de>2023-02-05 02:21:49 -0800
commit720f75f9881cae820cecde23fc2f07affacf2826 (patch)
tree31e891b6b3f877010c75905023166c8bad79df75
parentUpdate parsers: arduino, markdown, markdown_inline, tlaplus (diff)
downloadnvim-treesitter-720f75f9881cae820cecde23fc2f07affacf2826.tar
nvim-treesitter-720f75f9881cae820cecde23fc2f07affacf2826.tar.gz
nvim-treesitter-720f75f9881cae820cecde23fc2f07affacf2826.tar.bz2
nvim-treesitter-720f75f9881cae820cecde23fc2f07affacf2826.tar.lz
nvim-treesitter-720f75f9881cae820cecde23fc2f07affacf2826.tar.xz
nvim-treesitter-720f75f9881cae820cecde23fc2f07affacf2826.tar.zst
nvim-treesitter-720f75f9881cae820cecde23fc2f07affacf2826.zip
feat: add RON
-rw-r--r--README.md1
-rw-r--r--lockfile.json3
-rw-r--r--lua/nvim-treesitter/parsers.lua10
-rw-r--r--queries/ron/folds.scm7
-rw-r--r--queries/ron/highlights.scm53
-rw-r--r--queries/ron/indents.scm12
-rw-r--r--queries/ron/injections.scm4
-rw-r--r--queries/ron/locals.scm12
8 files changed, 100 insertions, 2 deletions
diff --git a/README.md b/README.md
index 874cdffb4..94dd25b5f 100644
--- a/README.md
+++ b/README.md
@@ -290,6 +290,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [regex](https://github.com/tree-sitter/tree-sitter-regex) (maintained by @theHamsta)
- [x] [rego](https://github.com/FallenAngel97/tree-sitter-rego) (maintained by @FallenAngel97)
- [x] [rnoweb](https://github.com/bamonroe/tree-sitter-rnoweb) (maintained by @bamonroe)
+- [x] [ron](https://github.com/amaanq/tree-sitter-ron) (maintained by @amaanq)
- [x] [rst](https://github.com/stsewd/tree-sitter-rst) (maintained by @stsewd)
- [x] [ruby](https://github.com/tree-sitter/tree-sitter-ruby) (maintained by @TravonteD)
- [x] [rust](https://github.com/tree-sitter/tree-sitter-rust) (maintained by @vigoux)
diff --git a/lockfile.json b/lockfile.json
index 8e0088af2..8529912b2 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -353,6 +353,9 @@
"rnoweb": {
"revision": "502c1126dc6777f09af5bef16e72a42f75bd081e"
},
+ "ron": {
+ "revision": "81e528eeb35518b8ef6f2761e91c0b10c76b4183"
+ },
"rst": {
"revision": "25e6328872ac3a764ba8b926aea12719741103f1"
},
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 024bdefce..33196bd8d 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -424,7 +424,6 @@ list.func = {
install_info = {
url = "https://github.com/amaanq/tree-sitter-func",
files = { "src/parser.c" },
- branch = "master",
},
maintainers = { "@amaanq" },
}
@@ -755,7 +754,6 @@ list.julia = {
list.kdl = {
install_info = {
url = "https://github.com/amaanq/tree-sitter-kdl",
- branch = "master",
files = { "src/parser.c", "src/scanner.c" },
},
maintainers = { "@amaanq" },
@@ -1128,6 +1126,14 @@ list.rnoweb = {
maintainers = { "@bamonroe" },
}
+list.ron = {
+ install_info = {
+ url = "https://github.com/amaanq/tree-sitter-ron",
+ files = { "src/parser.c", "src/scanner.c" },
+ },
+ maintainers = { "@amaanq" },
+}
+
list.rst = {
install_info = {
url = "https://github.com/stsewd/tree-sitter-rst",
diff --git a/queries/ron/folds.scm b/queries/ron/folds.scm
new file mode 100644
index 000000000..ae79583ea
--- /dev/null
+++ b/queries/ron/folds.scm
@@ -0,0 +1,7 @@
+[
+ (array)
+ (map)
+ (tuple)
+ (struct)
+ (block_comment)
+] @fold
diff --git a/queries/ron/highlights.scm b/queries/ron/highlights.scm
new file mode 100644
index 000000000..869264305
--- /dev/null
+++ b/queries/ron/highlights.scm
@@ -0,0 +1,53 @@
+; Structs
+;------------
+
+(enum_variant) @constant
+(struct_entry (identifier) @property)
+(struct_entry (enum_variant (identifier) @constant))
+(struct_name (identifier)) @type
+
+(unit_struct) @type.builtin
+
+
+; Literals
+;------------
+
+(string) @string
+(boolean) @boolean
+(integer) @number
+(float) @float
+(char) @character
+
+
+; Comments
+;------------
+
+[
+ (line_comment)
+ (block_comment)
+] @comment @spell
+
+
+; Punctuation
+;------------
+
+["{" "}"] @punctuation.bracket
+
+["(" ")"] @punctuation.bracket
+
+["[" "]"] @punctuation.bracket
+
+[
+ ","
+ ":"
+] @punctuation.delimiter
+
+[
+ "-"
+] @operator
+
+; Special
+;------------
+
+(escape_sequence) @string.escape
+(ERROR) @error
diff --git a/queries/ron/indents.scm b/queries/ron/indents.scm
new file mode 100644
index 000000000..84701a7e9
--- /dev/null
+++ b/queries/ron/indents.scm
@@ -0,0 +1,12 @@
+[
+ (array)
+ (map)
+ (tuple)
+ (struct)
+] @indent
+
+[ "{" "}" ] @branch
+
+[ "(" ")" ] @branch
+
+[ "[" "]" ] @branch
diff --git a/queries/ron/injections.scm b/queries/ron/injections.scm
new file mode 100644
index 000000000..e48ce9af3
--- /dev/null
+++ b/queries/ron/injections.scm
@@ -0,0 +1,4 @@
+[
+ (line_comment)
+ (block_comment)
+] @comment
diff --git a/queries/ron/locals.scm b/queries/ron/locals.scm
new file mode 100644
index 000000000..de90d35fd
--- /dev/null
+++ b/queries/ron/locals.scm
@@ -0,0 +1,12 @@
+(source_file) @scope
+(source_file (array) @scope)
+(source_file (map) @scope)
+(source_file (struct) @scope)
+(source_file (tuple) @scope)
+
+(identifier) @reference
+
+(struct_entry (identifier) @definition.field)
+(struct_entry (identifier) @definition.enum (enum_variant))
+
+(struct (struct_name) @definition.type)