mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-13 17:00:09 -04:00
Add @keyword.operator for operators that are English words and add @exception for Java/JS
This commit is contained in:
parent
c1313ba7af
commit
7e3c4f8089
10 changed files with 75 additions and 27 deletions
|
|
@ -101,13 +101,11 @@
|
|||
"class"
|
||||
"decltype"
|
||||
"constexpr"
|
||||
"delete"
|
||||
"explicit"
|
||||
"final"
|
||||
"friend"
|
||||
"mutable"
|
||||
"namespace"
|
||||
"new"
|
||||
"override"
|
||||
"private"
|
||||
"protected"
|
||||
|
|
@ -119,6 +117,26 @@
|
|||
(auto)
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"new"
|
||||
"delete"
|
||||
|
||||
;; these keywords are not supported by the parser
|
||||
;"eq"
|
||||
;"not_eq"
|
||||
;
|
||||
;"compl"
|
||||
;"and"
|
||||
;"or"
|
||||
;
|
||||
;"bitand"
|
||||
;"bitand_eq"
|
||||
;"bitor"
|
||||
;"bitor_eq"
|
||||
;"xor"
|
||||
;"xor_eq"
|
||||
] @keyword.operator
|
||||
|
||||
"::" @operator
|
||||
"..." @operator
|
||||
|
||||
|
|
|
|||
|
|
@ -141,7 +141,6 @@
|
|||
"abstract"
|
||||
"assert"
|
||||
"break"
|
||||
"catch"
|
||||
"class"
|
||||
"continue"
|
||||
"default"
|
||||
|
|
@ -149,13 +148,11 @@
|
|||
"exports"
|
||||
"extends"
|
||||
"final"
|
||||
"finally"
|
||||
"implements"
|
||||
"instanceof"
|
||||
"interface"
|
||||
"module"
|
||||
"native"
|
||||
"new"
|
||||
"open"
|
||||
"opens"
|
||||
"package"
|
||||
|
|
@ -168,17 +165,18 @@
|
|||
"static"
|
||||
"strictfp"
|
||||
"synchronized"
|
||||
"throw"
|
||||
"throws"
|
||||
"to"
|
||||
"transient"
|
||||
"transitive"
|
||||
"try"
|
||||
"uses"
|
||||
"volatile"
|
||||
"with"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"new"
|
||||
] @keyword.operator
|
||||
|
||||
; Conditionals
|
||||
|
||||
[
|
||||
|
|
@ -218,6 +216,16 @@
|
|||
")"
|
||||
] @punctuation.bracket
|
||||
|
||||
; Exceptions
|
||||
|
||||
[
|
||||
"throw"
|
||||
"throws"
|
||||
"finally"
|
||||
"try"
|
||||
"catch"
|
||||
] @exception
|
||||
|
||||
; Labels
|
||||
(labeled_statement
|
||||
(identifier) @label)
|
||||
|
|
|
|||
|
|
@ -184,30 +184,36 @@
|
|||
"async"
|
||||
"await"
|
||||
"break"
|
||||
"catch"
|
||||
"class"
|
||||
"const"
|
||||
"debugger"
|
||||
"delete"
|
||||
"export"
|
||||
"extends"
|
||||
"finally"
|
||||
"function"
|
||||
"get"
|
||||
"in"
|
||||
"instanceof"
|
||||
"let"
|
||||
"new"
|
||||
"return"
|
||||
"set"
|
||||
"static"
|
||||
"switch"
|
||||
"target"
|
||||
"throw"
|
||||
"try"
|
||||
"typeof"
|
||||
"var"
|
||||
"void"
|
||||
"with"
|
||||
"yield"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"new"
|
||||
"delete"
|
||||
] @keyword.operator
|
||||
|
||||
[
|
||||
"throw"
|
||||
"try"
|
||||
"catch"
|
||||
"finally"
|
||||
] @exception
|
||||
|
|
|
|||
|
|
@ -51,15 +51,19 @@
|
|||
] @keyword
|
||||
|
||||
;; Operators
|
||||
|
||||
[
|
||||
"not"
|
||||
"and"
|
||||
"or"
|
||||
] @keyword.operator
|
||||
|
||||
[
|
||||
"="
|
||||
"~="
|
||||
"=="
|
||||
"<="
|
||||
">="
|
||||
"not"
|
||||
"and"
|
||||
"or"
|
||||
"<"
|
||||
">"
|
||||
"+"
|
||||
|
|
|
|||
|
|
@ -157,15 +157,19 @@
|
|||
"|"
|
||||
"|="
|
||||
"~"
|
||||
"->"
|
||||
] @operator
|
||||
|
||||
; Keywords
|
||||
[
|
||||
"and"
|
||||
"in"
|
||||
"is"
|
||||
"not"
|
||||
"or"
|
||||
"->"
|
||||
] @operator
|
||||
|
||||
; Keywords
|
||||
"del"
|
||||
] @keyword.operator
|
||||
|
||||
[
|
||||
"assert"
|
||||
|
|
@ -173,7 +177,6 @@
|
|||
"await"
|
||||
"class"
|
||||
"def"
|
||||
"del"
|
||||
"except"
|
||||
"exec"
|
||||
"finally"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
[
|
||||
"alias"
|
||||
"and"
|
||||
"begin"
|
||||
"break"
|
||||
"class"
|
||||
|
|
@ -13,10 +12,8 @@
|
|||
"do"
|
||||
"end"
|
||||
"ensure"
|
||||
"in"
|
||||
"module"
|
||||
"next"
|
||||
"or"
|
||||
"rescue"
|
||||
"retry"
|
||||
"return"
|
||||
|
|
@ -24,6 +21,12 @@
|
|||
"yield"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"and"
|
||||
"or"
|
||||
"in"
|
||||
] @keyword.operator
|
||||
|
||||
[
|
||||
"case"
|
||||
"else"
|
||||
|
|
|
|||
|
|
@ -163,7 +163,10 @@
|
|||
(escape_sequence) @string.escape
|
||||
|
||||
[
|
||||
"as"
|
||||
"as"
|
||||
] @keyword.operator
|
||||
|
||||
[
|
||||
"*"
|
||||
"'"
|
||||
"->"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue