mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 19:00:02 -04:00
Add some operators and match classes (with regex)
This commit is contained in:
parent
1611998ca9
commit
2ae63525dc
1 changed files with 41 additions and 6 deletions
|
|
@ -13,12 +13,42 @@
|
||||||
(marker_annotation
|
(marker_annotation
|
||||||
name: (identifier) @attribute)
|
name: (identifier) @attribute)
|
||||||
|
|
||||||
; TODO: operators
|
; Operators
|
||||||
|
|
||||||
[
|
[
|
||||||
"@"
|
"@"
|
||||||
|
"=>"
|
||||||
|
".."
|
||||||
|
"??"
|
||||||
|
"=="
|
||||||
|
"?"
|
||||||
|
":"
|
||||||
|
"&&"
|
||||||
|
"%"
|
||||||
|
"<"
|
||||||
|
">"
|
||||||
|
">="
|
||||||
|
"<="
|
||||||
|
"||"
|
||||||
|
(is_operator)
|
||||||
|
(prefix_operator)
|
||||||
|
(equality_operator)
|
||||||
(additive_operator)
|
(additive_operator)
|
||||||
] @operator
|
] @operator
|
||||||
; TODO: delimiers/punctuation
|
|
||||||
|
; Delimiters
|
||||||
|
|
||||||
|
"." @punctuation.delimiter
|
||||||
|
"," @punctuation.delimiter
|
||||||
|
";" @punctuation.delimiter
|
||||||
|
|
||||||
|
"(" @punctuation.bracket
|
||||||
|
")" @punctuation.bracket
|
||||||
|
"{" @punctuation.bracket
|
||||||
|
"}" @punctuation.bracket
|
||||||
|
"[" @punctuation.bracket
|
||||||
|
"]" @punctuation.bracket
|
||||||
|
|
||||||
|
|
||||||
; Types
|
; Types
|
||||||
|
|
||||||
|
|
@ -48,8 +78,8 @@
|
||||||
|
|
||||||
; Variables
|
; Variables
|
||||||
|
|
||||||
((identifier) @constant
|
((identifier) @type
|
||||||
(#match? @constant "^_*[A-Z][A-Z\d_]+"))
|
(#match? @type "^[A-Z]"))
|
||||||
|
|
||||||
(this) @constant.builtin
|
(this) @constant.builtin
|
||||||
|
|
||||||
|
|
@ -86,13 +116,18 @@
|
||||||
"extends"
|
"extends"
|
||||||
"final"
|
"final"
|
||||||
"implements"
|
"implements"
|
||||||
"is"
|
|
||||||
"as"
|
"as"
|
||||||
"mixin"
|
"mixin"
|
||||||
"external"
|
"external"
|
||||||
"new"
|
"new"
|
||||||
"return"
|
"return"
|
||||||
"static"
|
"static"
|
||||||
|
"required"
|
||||||
|
"var"
|
||||||
|
"const"
|
||||||
|
"async"
|
||||||
|
"await"
|
||||||
|
; "rethrow"
|
||||||
] @keyword
|
] @keyword
|
||||||
;TODO: var, async, await
|
;TODO: var, async, await
|
||||||
; "rethrow" @keyword
|
; "rethrow" @keyword
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue