aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPedro Castro <aspeddro@gmail.com>2022-03-28 16:17:28 -0300
committerGitHub <noreply@github.com>2022-03-28 21:17:28 +0200
commit249cd3ac3ec7e237310def2cc91602271eace255 (patch)
tree2ab953432b41c1e1f6015b348141987f21d8c2ca
parentUpdate lockfile.json (diff)
downloadnvim-treesitter-249cd3ac3ec7e237310def2cc91602271eace255.tar
nvim-treesitter-249cd3ac3ec7e237310def2cc91602271eace255.tar.gz
nvim-treesitter-249cd3ac3ec7e237310def2cc91602271eace255.tar.bz2
nvim-treesitter-249cd3ac3ec7e237310def2cc91602271eace255.tar.lz
nvim-treesitter-249cd3ac3ec7e237310def2cc91602271eace255.tar.xz
nvim-treesitter-249cd3ac3ec7e237310def2cc91602271eace255.tar.zst
nvim-treesitter-249cd3ac3ec7e237310def2cc91602271eace255.zip
r(highlights): add default parameter/argument (#2688)
* Update lockfile.json * r(highlights): default argument/parameter and some updates
-rw-r--r--lockfile.json2
-rwxr-xr-xqueries/r/highlights.scm15
2 files changed, 7 insertions, 10 deletions
diff --git a/lockfile.json b/lockfile.json
index 34b77e93f..4f7726bb7 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -225,7 +225,7 @@
"revision": "5217c6805c09f8fc00ed13d17d5fcb791437aee6"
},
"r": {
- "revision": "c19e54de252d5573cc2a762a030957074526fe99"
+ "revision": "cc04302e1bff76fa02e129f332f44636813b0c3c"
},
"rasi": {
"revision": "e2961f02244c068a67549adf896b0779e4a29516"
diff --git a/queries/r/highlights.scm b/queries/r/highlights.scm
index 2688746b9..8cc8727b4 100755
--- a/queries/r/highlights.scm
+++ b/queries/r/highlights.scm
@@ -8,13 +8,14 @@
(complex) @number
(string) @string
+(string (escape_sequence) @string.escape)
(comment) @comment
(identifier) @variable
(formal_parameters (identifier) @parameter)
-
+(formal_parameters (default_parameter (identifier) @parameter))
; Operators
[
"="
@@ -55,6 +56,8 @@
(special)
] @operator
+(lambda_function "\\" @operator)
+
[
"("
")"
@@ -87,6 +90,7 @@
[
"if"
"else"
+ "switch"
] @conditional
[
@@ -103,12 +107,7 @@
"function" @keyword.function
(call function: (identifier) @function)
-
-(call arguments:
- (arguments
- name: (identifier) @parameter))
-
-(lambda_function "\\" @operator)
+(default_argument name: (identifier) @parameter)
(namespace_get function: (identifier) @method)
(namespace_get_internal function: (identifier) @method)
@@ -119,7 +118,5 @@
(namespace_get_internal namespace: (identifier) @namespace
":::" @operator)
-(string (escape_sequence) @string.escape)
-
; Error
(ERROR) @error