mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:26:23 -04:00
docs(queries): clarify behavior of first child anchor example
(cherry picked from commit b53a0fe622)
This commit is contained in:
parent
77b741bb83
commit
fa6222a0d3
|
|
@ -180,7 +180,7 @@ depending on where it's placed inside a query.
|
|||
|
||||
When `.` is placed before the _first_ child within a parent pattern, the child will only match when it is the first named
|
||||
node in the parent. For example, the below pattern matches a given `array` node at most once, assigning the `@the-element`
|
||||
capture to the first `identifier` node in the parent `array`:
|
||||
capture to the first node in the parent `array`, only if it's an `identifier` node:
|
||||
|
||||
```query
|
||||
(array . (identifier) @the-element)
|
||||
|
|
|
|||
Loading…
Reference in a new issue