mirror of
https://github.com/chenasraf/nvim-treesitter.git
synced 2026-05-18 01:39:00 +00:00
feat: add language support for corn (#4864)
Adds queries and a parser mapping for the [Corn](https://github.com/jakestanger/corn) configuration language.
This commit is contained in:
@@ -237,6 +237,14 @@ list.cooklang = {
|
||||
maintainers = { "@addcninblue" },
|
||||
}
|
||||
|
||||
list.corn = {
|
||||
install_info = {
|
||||
url = "https://github.com/jakestanger/tree-sitter-corn",
|
||||
files = { "src/parser.c" },
|
||||
},
|
||||
maintainers = { "@jakestanger" },
|
||||
}
|
||||
|
||||
list.cpon = {
|
||||
install_info = {
|
||||
url = "https://github.com/amaanq/tree-sitter-cpon",
|
||||
|
||||
5
queries/corn/folds.scm
Normal file
5
queries/corn/folds.scm
Normal file
@@ -0,0 +1,5 @@
|
||||
[
|
||||
(object)
|
||||
(array)
|
||||
(assign_block)
|
||||
] @fold
|
||||
22
queries/corn/highlights.scm
Normal file
22
queries/corn/highlights.scm
Normal file
@@ -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
|
||||
14
queries/corn/indents.scm
Normal file
14
queries/corn/indents.scm
Normal file
@@ -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)
|
||||
16
queries/corn/locals.scm
Normal file
16
queries/corn/locals.scm
Normal file
@@ -0,0 +1,16 @@
|
||||
; scopes
|
||||
|
||||
[
|
||||
(object)
|
||||
(array)
|
||||
] @scope
|
||||
|
||||
; definitions
|
||||
|
||||
(assign_block
|
||||
(assignment
|
||||
(input)
|
||||
@definition.constant))
|
||||
|
||||
(value (input) @reference)
|
||||
|
||||
Reference in New Issue
Block a user