Docs: document _ wildcard node

Closes https://github.com/tree-sitter/tree-sitter/issues/1253
This commit is contained in:
Santos Gallegos 2021-07-11 10:25:42 -05:00
parent 0926fad1e2
commit 4adc2f5c88
No known key found for this signature in database
GPG key ID: 811173C303342045

View file

@ -586,8 +586,10 @@ This pattern would match a set of possible keyword tokens, capturing them as `@k
#### Wildcard Node
A wildcard node is represented with an underscore (`(_)`), it matches any node.
A wildcard node is represented with an underscore (`_`), it matches any node.
This is similar to `.` in regular expressions.
There are two types, `(_)` will match any named node,
and `_` will match any named or anonymous node.
For example, this pattern would match any node inside a call: