mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-06 05:20:00 -04:00
parsers: add nickel parser (#3506)
* parsers: add nickel parser * Update lua/nvim-treesitter/parsers.lua Co-authored-by: Christian Clason <christian.clason@uni-due.de> * Update queries/nickel/highlights.scm Co-authored-by: Christian Clason <christian.clason@uni-due.de> * fix queries * Cleanup (based on @theHamsta review) Co-authored-by: Christian Clason <christian.clason@uni-due.de>
This commit is contained in:
parent
1e4b23c266
commit
470b872d57
2 changed files with 69 additions and 0 deletions
|
|
@ -1211,6 +1211,14 @@ list.gitignore = {
|
|||
maintainers = { "@theHamsta" },
|
||||
}
|
||||
|
||||
list.nickel = {
|
||||
install_info = {
|
||||
url = "https://github.com/nickel-lang/tree-sitter-nickel",
|
||||
files = { "src/parser.c", "src/scanner.cc" },
|
||||
branch = "main",
|
||||
},
|
||||
}
|
||||
|
||||
list.gitattributes = {
|
||||
install_info = {
|
||||
url = "https://github.com/ObserverOfTime/tree-sitter-gitattributes",
|
||||
|
|
|
|||
61
queries/nickel/highlights.scm
Normal file
61
queries/nickel/highlights.scm
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
(comment) @comment @spell
|
||||
|
||||
[
|
||||
"forall"
|
||||
"in"
|
||||
"let"
|
||||
"default"
|
||||
"doc"
|
||||
"rec"
|
||||
] @keyword
|
||||
|
||||
"fun" @keyword.function
|
||||
|
||||
"import" @include
|
||||
|
||||
[ "if" "then" "else" ] @conditional
|
||||
"switch" @conditional
|
||||
|
||||
(types) @type
|
||||
"Array" @type.builtin
|
||||
|
||||
; BUILTIN Constants
|
||||
(bool) @constant.builtin
|
||||
"null" @constant.builtin
|
||||
|
||||
(num_literal) @number
|
||||
|
||||
(infix_op) @operator
|
||||
|
||||
(type_atom) @type
|
||||
(enum_tag) @variable
|
||||
|
||||
(chunk_literal_single) @string
|
||||
(chunk_literal_multi) @string
|
||||
|
||||
(str_esc_char) @string.escape
|
||||
|
||||
[
|
||||
"{" "}"
|
||||
"(" ")"
|
||||
"[|" "|]"
|
||||
] @punctuation.bracket
|
||||
|
||||
(multstr_start) @punctuation.bracket
|
||||
(multstr_end) @punctuation.bracket
|
||||
(interpolation_start) @punctuation.bracket
|
||||
(interpolation_end) @punctuation.bracket
|
||||
|
||||
(record_field) @field
|
||||
|
||||
(builtin) @function.builtin
|
||||
|
||||
(fun_expr pats:
|
||||
(pattern id:
|
||||
(ident) @parameter
|
||||
)
|
||||
)
|
||||
|
||||
(applicative t1:
|
||||
(applicative (record_operand) @function)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue