Repository navigation
Commit 93a2dcd
committed
yeast: Consolidate multiple captures appropriately
Getting even more into the weeds of the query matching semantics, what
should something like
```
(foo bar: (bar) @item
baz: (baz) @@item
)
```
do?
Or what about something like
```
(foo bar: (bar) @item
baz: (baz)* @item
)
```
?
At present, we permit captures to have multiple occurrences in a query.
Each occurrence simply pushes yet another value into the capture.
With this in mind, the sensible semantics (which we implement in this
commit) seem to be the following:
- If any of the captures (with a given identifier) are raw, then so is
the entire capture.
- If we capture both individual items and lists, then the entire capture
is a list.
Note that we don't actually (as far as I know) use these constructions
anywhere, but the previous behaviour would just cause weird things to
potentially happen. At least now the behaviour should be a bit more
predictable.1 parent f3f66db commit 93a2dcd
2 files changed
Lines changed: 65 additions & 2 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
198 | 217 | | |
199 | 218 | | |
200 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
471 | 515 | | |
472 | 516 | | |
473 | 517 | | |
| |||
0 commit comments