Skip to content

Commit 4bc8d4f

Browse files
committed
Correct name and value scopes and queries
1 parent f8a9222 commit 4bc8d4f

File tree

5 files changed

+29
-19
lines changed

5 files changed

+29
-19
lines changed

data/fixtures/scopes/r/name.assignment.scope

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
hello = "world"
22
---
33

4-
[Content] =
5-
[Domain] = 0:0-0:5
4+
[Content] = 0:0-0:5
65
>-----<
76
0| hello = "world"
87

@@ -14,4 +13,8 @@ hello = "world"
1413
>---<
1514
0| hello = "world"
1615

17-
[Insertion delimiter] = " = "
16+
[Domain] = 0:0-0:15
17+
>---------------<
18+
0| hello = "world"
19+
20+
[Insertion delimiter] = " "

data/fixtures/scopes/r/name.variable.scope

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
hello <- "world"
22
---
33

4-
[Content] =
5-
[Domain] = 0:0-0:5
4+
[Content] = 0:0-0:5
65
>-----<
76
0| hello <- "world"
87

@@ -14,4 +13,8 @@ hello <- "world"
1413
>----<
1514
0| hello <- "world"
1615

17-
[Insertion delimiter] = " <- "
16+
[Domain] = 0:0-0:16
17+
>----------------<
18+
0| hello <- "world"
19+
20+
[Insertion delimiter] = " "

data/fixtures/scopes/r/value.assignment.scope

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
hello <- "world"
22
---
33

4-
[Content] =
5-
[Domain] = 0:9-0:16
4+
[Content] = 0:9-0:16
65
>-------<
76
0| hello <- "world"
87

@@ -14,4 +13,8 @@ hello <- "world"
1413
>----<
1514
0| hello <- "world"
1615

17-
[Insertion delimiter] = " <- "
16+
[Domain] = 0:0-0:16
17+
>----------------<
18+
0| hello <- "world"
19+
20+
[Insertion delimiter] = " "

data/fixtures/scopes/r/value.variable.scope

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
hello = "world"
22
---
33

4-
[Content] =
5-
[Domain] = 0:8-0:15
4+
[Content] = 0:8-0:15
65
>-------<
76
0| hello = "world"
87

@@ -14,4 +13,8 @@ hello = "world"
1413
>---<
1514
0| hello = "world"
1615

16+
[Domain] = 0:0-0:15
17+
>---------------<
18+
0| hello = "world"
19+
1720
[Insertion delimiter] = " "

queries/r.scm

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
)
9090

9191
;; Technically lists and arrays are just calls to the function `list` or `c`
92-
;; TODO: should this include the function name/brackets?
9392
;;!! list(1, 2, 3)
9493
;;! ^^^^^^^^^^^^^
9594
(call
@@ -101,24 +100,23 @@
101100
;;!! hello <- "world"
102101
;;! ^^^^^
103102
;;! -----
104-
lhs: (identifier) @name
103+
lhs: (identifier) @name @value.leading.endOf
105104
operator: "<-"
106105
;;!! hello <- "world"
107106
;;! ^^^^^^^
108107
;;! -----
109-
rhs: (_) @value
110-
)
108+
rhs: (_) @value @name.trailing.startOf
109+
) @_.domain
111110
(binary_operator
112111
;;!! hello <- "world"
113112
;;! ^^^^^
114-
;;! -----
115-
lhs: (identifier) @name
113+
lhs: (identifier) @name @value.leading.endOf
116114
operator: "="
117115
;;!! hello <- "world"
118116
;;! ^^^^^^^
119117
;;! -----
120-
rhs: (_) @value
121-
)
118+
rhs: (_) @value @name.trailing.startOf
119+
) @_.domain
122120

123121
;;!! foo(hello)
124122
;;! ^^^^^

0 commit comments

Comments
 (0)