diff options
| -rw-r--r-- | lockfile.json | 3 | ||||
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 8 | ||||
| -rw-r--r-- | queries/gren/highlights.scm | 121 | ||||
| -rw-r--r-- | queries/gren/injections.scm | 5 |
4 files changed, 137 insertions, 0 deletions
diff --git a/lockfile.json b/lockfile.json index 3d23f864b..2d53b1bf7 100644 --- a/lockfile.json +++ b/lockfile.json @@ -278,6 +278,9 @@ "gpg": { "revision": "f99323fb8f3f10b6c69db0c2f6d0a14bd7330675" }, + "gren": { + "revision": "19cd4c08ef86afb6fa7566fee9ac642e53b996d5" + }, "graphql": { "revision": "5e66e961eee421786bdda8495ed1db045e06b5fe" }, diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index b5853c04f..9c85ae118 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -850,6 +850,14 @@ list.gpg = { maintainers = { "@ObserverOfTime" }, } +list.gren = { + install_info = { + files = { "src/parser.c", "src/scanner.c" }, + url = "https://github.com/MaeBrooks/tree-sitter-gren", + }, + maintainers = { "@MaeBrooks" }, +} + list.groovy = { install_info = { url = "https://github.com/murtaza64/tree-sitter-groovy", diff --git a/queries/gren/highlights.scm b/queries/gren/highlights.scm new file mode 100644 index 000000000..5cc6fff54 --- /dev/null +++ b/queries/gren/highlights.scm @@ -0,0 +1,121 @@ +; Keywords +[ + (as) + (port) + (exposing) + (alias) + (infix) +] @keyword + +; Keywords - Conditionals +[ + "if" + "then" + "else" + "let" + "in" + (case) + (of) +] @keyword.conditional + +; Keywords - Imports +[ + (import) + (module) +] @keyword.import + +; Operators +[ + (arrow) + (backslash) + (colon) + (operator_identifier) + (eq) +] @operator + +; Punctuation +[ + "(" + ")" + "{" + "}" + "[" + "]" +] @punctuation.bracket + +[ + "," + "|" + (dot) +] @punctuation.delimiter + +; Comments +[ + (block_comment) + (line_comment) +] @comment + +; Strings +[ + (close_quote) + (open_quote) + (regular_string_part) +] @string + +; Strings - Escape +(string_escape) @string.escape + +; Characters +[ + (open_char) + (close_char) +] @character + +(type_annotation + (lower_case_identifier) @function) + +(port_annotation + (lower_case_identifier) @function) + +(function_declaration_left + (lower_case_identifier) @function) + +(function_call_expr + target: (value_expr) @function) + +(field_access_expr + (value_expr + (value_qid) @variable.member)) + +(lower_pattern) @variable.parameter + +(record_base_identifier) @variable + +(number_constant_expr) @number + +(type) @keyword.type + +(type_declaration + (upper_case_identifier) @type) + +(type_ref) @type + +(type_alias_declaration + name: (upper_case_identifier) @type) + +(union_variant + (upper_case_identifier) @type) + +(union_pattern + constructor: (upper_case_qid + (upper_case_identifier) @label + (dot) + (upper_case_identifier) @type)) + +(union_pattern + constructor: (upper_case_qid + (upper_case_identifier) @type)) + +(value_expr + (upper_case_qid + (upper_case_identifier)) @type) diff --git a/queries/gren/injections.scm b/queries/gren/injections.scm new file mode 100644 index 000000000..3cd6aac8e --- /dev/null +++ b/queries/gren/injections.scm @@ -0,0 +1,5 @@ +([ + (line_comment) + (block_comment) +] @injection.content + (#set! injection.language "comment")) |
