diff options
| author | Pham Huy Hoang <hoangtun0810@gmail.com> | 2024-01-06 15:05:50 +0900 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-01-19 16:58:37 +0100 |
| commit | 57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9 (patch) | |
| tree | 70bf645539882b88e6fa129cefd30986b89bbac3 /queries/elvish | |
| parent | ci: add query lint job (diff) | |
| download | nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.gz nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.bz2 nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.lz nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.xz nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.zst nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.zip | |
chore: query formatting
Diffstat (limited to 'queries/elvish')
| -rw-r--r-- | queries/elvish/highlights.scm | 155 | ||||
| -rw-r--r-- | queries/elvish/injections.scm | 4 |
2 files changed, 122 insertions, 37 deletions
diff --git a/queries/elvish/highlights.scm b/queries/elvish/highlights.scm index d6243549f..a2fd9302c 100644 --- a/queries/elvish/highlights.scm +++ b/queries/elvish/highlights.scm @@ -1,32 +1,90 @@ (comment) @comment @spell -["if" "elif"] @keyword.conditional -(if (else "else" @keyword.conditional)) +[ + "if" + "elif" +] @keyword.conditional + +(if + (else + "else" @keyword.conditional)) + +[ + "while" + "for" +] @keyword.repeat -["while" "for"] @keyword.repeat -(while (else "else" @keyword.repeat)) -(for (else "else" @keyword.repeat)) +(while + (else + "else" @keyword.repeat)) + +(for + (else + "else" @keyword.repeat)) + +[ + "try" + "catch" + "finally" +] @keyword.exception -["try" "catch" "finally"] @keyword.exception -(try (else "else" @keyword.exception)) +(try + (else + "else" @keyword.exception)) "use" @keyword.import -(import (bareword) @string.special.path) -(wildcard ["*" "**" "?"] @character.special) +(import + (bareword) @string.special.path) + +(wildcard + [ + "*" + "**" + "?" + ] @character.special) + +(command + argument: (bareword) @variable.parameter) + +(command + head: (identifier) @function.call) + +((command + head: (identifier) @keyword.return) + (#eq? @keyword.return "return")) + +((command + (identifier) @keyword.operator) + (#any-of? @keyword.operator "and" "or" "coalesce")) -(command argument: (bareword) @variable.parameter) -(command head: (identifier) @function.call) -((command head: (identifier) @keyword.return) - (#eq? @keyword.return "return")) -((command (identifier) @keyword.operator) - (#any-of? @keyword.operator "and" "or" "coalesce")) [ - "+" "-" "*" "/" "%" "<" "<=""==" "!=" ">" - ">=" "<s" "<=s" "==s" "!=s" ">s" ">=s" + "+" + "-" + "*" + "/" + "%" + "<" + "<=" + "==" + "!=" + ">" + ">=" + "<s" + "<=s" + "==s" + "!=s" + ">s" + ">=s" ] @function.builtin -[">" "<" ">>" "<>" "|"] @operator +[ + ">" + "<" + ">>" + "<>" + "|" +] @operator (io_port) @number @@ -35,36 +93,63 @@ (identifier) @function) (parameter_list) @variable.parameter -(parameter_list "|" @punctuation.bracket) -["var" "set" "tmp" "del"] @keyword +(parameter_list + "|" @punctuation.bracket) + +[ + "var" + "set" + "tmp" + "del" +] @keyword + (variable_declaration - (lhs (identifier) @variable)) + (lhs + (identifier) @variable)) (variable_assignment - (lhs (identifier) @variable)) + (lhs + (identifier) @variable)) (temporary_assignment - (lhs (identifier) @variable)) + (lhs + (identifier) @variable)) (variable_deletion (identifier) @variable) - (number) @number + (string) @string -(variable (identifier) @variable) -((variable (identifier) @function) +(variable + (identifier) @variable) + +((variable + (identifier) @function) (#match? @function ".+\\~$")) -((variable (identifier) @boolean) - (#any-of? @boolean "true" "false")) -((variable (identifier) @constant.builtin) - (#any-of? @constant.builtin - "_" "after-chdir" "args" "before-chdir" "buildinfo" "nil" - "notify-bg-job-success" "num-bg-jobs" "ok" "paths" "pid" - "pwd" "value-out-indicator" "version")) -["$" "@"] @punctuation.special -["(" ")" "[" "]" "{" "}"] @punctuation.bracket +((variable + (identifier) @boolean) + (#any-of? @boolean "true" "false")) + +((variable + (identifier) @constant.builtin) + (#any-of? @constant.builtin "_" "after-chdir" "args" "before-chdir" "buildinfo" "nil" "notify-bg-job-success" "num-bg-jobs" "ok" "paths" "pid" "pwd" "value-out-indicator" "version")) + +[ + "$" + "@" +] @punctuation.special + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + ";" @punctuation.delimiter diff --git a/queries/elvish/injections.scm b/queries/elvish/injections.scm index 6adae45a2..2f0e58eb6 100644 --- a/queries/elvish/injections.scm +++ b/queries/elvish/injections.scm @@ -1,2 +1,2 @@ -((comment) @injection.content - (#set! injection.language "comment")) +((comment) @injection.content + (#set! injection.language "comment")) |
