aboutsummaryrefslogtreecommitdiffstats
path: root/tests/query/highlights/r/test.r
blob: 5fa36cc56c8b17ee157b493d79057c4a485484f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
init <- 1
# ^ @variable
#     ^ @operator
#       ^ @number.float

r"{(\1\2)}" -> `%r%`
#  ^ @string
#           ^ @operator
#               ^ @variable


foo <- c(1L, 2L)
#      ^ @function.call
#        ^ @number

b <- list(TRUE, FALSE, NA, Inf)
#          ^ @boolean
#                ^ @boolean
#                      ^ @constant.builtin
#                           ^ @constant.builtin

b <- list(name = "r", version = R.version$major)
#          ^ @variable.parameter
#                 ^ @string
#                                        ^ @operator
#                                           ^ @variable.member

Lang$new(name = "r")$print()
#     ^ @function.method.call

for(i in 1:10) {
# <- @keyword.repeat
#      ^ @keyword.repeat
}

add <- function(a, b = 1, ...) {
#        ^ @keyword.function
#               ^ @variable.parameter
#                  ^ @variable.parameter
#                         ^ @constant.builtin
  return(a + b)
# ^ @keyword.return
}

base::letters
# ^ @module
#        ^ @variable