mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-03 03:56:52 -04:00
refactor(queries): simplify highlight queries for elvish
This commit is contained in:
parent
e06b54b64e
commit
570ad70bbb
1 changed files with 11 additions and 20 deletions
|
|
@ -1,23 +1,19 @@
|
|||
(comment) @comment
|
||||
|
||||
(if "if" @conditional)
|
||||
(if (elif "elif" @conditional))
|
||||
["if" "elif"] @conditional
|
||||
(if (else "else" @conditional))
|
||||
|
||||
(while "while" @repeat)
|
||||
["while" "for"] @repeat
|
||||
(while (else "else" @repeat))
|
||||
(for "for" @repeat)
|
||||
(for (else "else" @repeat))
|
||||
|
||||
(try "try" @exception)
|
||||
(try (catch "catch" @exception))
|
||||
["try" "catch" "finally"] @exception
|
||||
(try (else "else" @exception))
|
||||
(try (finally "finally" @exception))
|
||||
|
||||
(import "use" @include)
|
||||
"use" @include
|
||||
(import (bareword) @string.special)
|
||||
|
||||
(wildcard ["*" "**" "?"] @string.special)
|
||||
["*" "**" "?"] @string.special
|
||||
|
||||
(command argument: (bareword) @parameter)
|
||||
(command head: (identifier) @function)
|
||||
|
|
@ -25,14 +21,12 @@
|
|||
(#eq? @keyword.return "return"))
|
||||
((command (identifier) @keyword.operator)
|
||||
(#any-of? @keyword.operator "and" "or" "coalesce"))
|
||||
((command head: _ @function)
|
||||
(#any-of? @function
|
||||
"+" "-" "*" "/" "%" "<" "<=""==" "!=" ">"
|
||||
">=" "<s" "<=s" "==s" "!=s" ">s" ">=s"
|
||||
))
|
||||
[
|
||||
"+" "-" "*" "/" "%" "<" "<=""==" "!=" ">"
|
||||
">=" "<s" "<=s" "==s" "!=s" ">s" ">=s"
|
||||
] @function
|
||||
|
||||
(pipeline "|" @operator)
|
||||
(redirection [">" "<" ">>" "<>"] @operator)
|
||||
[">" "<" ">>" "<>" "|"] @operator
|
||||
|
||||
(io_port) @number
|
||||
|
||||
|
|
@ -43,20 +37,17 @@
|
|||
(parameter_list) @parameter
|
||||
(parameter_list "|" @punctuation.bracket)
|
||||
|
||||
["var" "set" "tmp" "del"] @keyword
|
||||
(variable_declaration
|
||||
"var" @keyword
|
||||
(lhs (identifier) @variable))
|
||||
|
||||
(variable_assignment
|
||||
"set" @keyword
|
||||
(lhs (identifier) @variable))
|
||||
|
||||
(temporary_assignment
|
||||
"tmp" @keyword
|
||||
(lhs (identifier) @variable))
|
||||
|
||||
(variable_deletion
|
||||
"del" @keyword
|
||||
(identifier) @variable)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue