diff options
| author | José Luis Lafuente <jl@lafuente.me> | 2022-10-20 01:33:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-19 23:33:31 +0000 |
| commit | 470b872d5747819623c7b3a98eb320dc3cab95b4 (patch) | |
| tree | 5af95a6999ab6e1a6f28a746d033b5010e73de62 /queries/nickel | |
| parent | 1e4b23c26678bd36e3da638183996eaa30e7fba8 (diff) | |
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>
Diffstat (limited to 'queries/nickel')
| -rw-r--r-- | queries/nickel/highlights.scm | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/queries/nickel/highlights.scm b/queries/nickel/highlights.scm new file mode 100644 index 00000000..53f4c134 --- /dev/null +++ b/queries/nickel/highlights.scm @@ -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) +) |
