aboutsummaryrefslogtreecommitdiffstats
path: root/queries/corn
diff options
context:
space:
mode:
authorJake Stanger <mail@jstanger.dev>2023-05-29 09:26:28 +0100
committerGitHub <noreply@github.com>2023-05-29 17:26:28 +0900
commitdc38ff85d9dff0582857132df1acc645fda98756 (patch)
tree335cc8441ea6fa0a3aa7337d1008daced88bed25 /queries/corn
parentUpdate parsers: php, scala (diff)
downloadnvim-treesitter-dc38ff85d9dff0582857132df1acc645fda98756.tar
nvim-treesitter-dc38ff85d9dff0582857132df1acc645fda98756.tar.gz
nvim-treesitter-dc38ff85d9dff0582857132df1acc645fda98756.tar.bz2
nvim-treesitter-dc38ff85d9dff0582857132df1acc645fda98756.tar.lz
nvim-treesitter-dc38ff85d9dff0582857132df1acc645fda98756.tar.xz
nvim-treesitter-dc38ff85d9dff0582857132df1acc645fda98756.tar.zst
nvim-treesitter-dc38ff85d9dff0582857132df1acc645fda98756.zip
feat: add language support for corn (#4864)
Adds queries and a parser mapping for the [Corn](https://github.com/jakestanger/corn) configuration language.
Diffstat (limited to 'queries/corn')
-rw-r--r--queries/corn/folds.scm5
-rw-r--r--queries/corn/highlights.scm22
-rw-r--r--queries/corn/indents.scm14
-rw-r--r--queries/corn/locals.scm16
4 files changed, 57 insertions, 0 deletions
diff --git a/queries/corn/folds.scm b/queries/corn/folds.scm
new file mode 100644
index 000000000..c081ecb47
--- /dev/null
+++ b/queries/corn/folds.scm
@@ -0,0 +1,5 @@
+[
+ (object)
+ (array)
+ (assign_block)
+] @fold
diff --git a/queries/corn/highlights.scm b/queries/corn/highlights.scm
new file mode 100644
index 000000000..9bb0274e5
--- /dev/null
+++ b/queries/corn/highlights.scm
@@ -0,0 +1,22 @@
+"let" @keyword
+"in" @keyword
+
+[
+ "{"
+ "}"
+ "["
+ "]"
+] @punctuation.bracket
+
+"." @punctuation.delimiter
+
+(input) @constant
+(comment) @comment
+
+(string) @string
+(integer) @number
+(float) @float
+(boolean) @boolean
+(null) @keyword
+
+(ERROR) @error
diff --git a/queries/corn/indents.scm b/queries/corn/indents.scm
new file mode 100644
index 000000000..1f5a2c402
--- /dev/null
+++ b/queries/corn/indents.scm
@@ -0,0 +1,14 @@
+[
+ (assign_block "{")
+ (object)
+ (array)
+] @indent.begin
+
+(assign_block "}" @indent.branch)
+(assign_block "}" @indent.end)
+
+(object "}" @indent.branch)
+(object "}" @indent.end)
+
+(array "]" @indent.branch)
+(array "]" @indent.end)
diff --git a/queries/corn/locals.scm b/queries/corn/locals.scm
new file mode 100644
index 000000000..f6b0d4c70
--- /dev/null
+++ b/queries/corn/locals.scm
@@ -0,0 +1,16 @@
+; scopes
+
+[
+ (object)
+ (array)
+] @scope
+
+; definitions
+
+(assign_block
+ (assignment
+ (input)
+ @definition.constant))
+
+(value (input) @reference)
+