Merge pull request #1254 from stsewd/doc-wildcard-node

Docs: document `_` wildcard node
This commit is contained in:
Max Brunsfeld 2021-07-11 09:58:39 -07:00 committed by GitHub
commit 586f69f113
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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: