From 4adc2f5c882e97b3ef7206960972b4646fff2c3c Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Sun, 11 Jul 2021 10:25:42 -0500 Subject: [PATCH] Docs: document `_` wildcard node Closes https://github.com/tree-sitter/tree-sitter/issues/1253 --- docs/section-2-using-parsers.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/section-2-using-parsers.md b/docs/section-2-using-parsers.md index 06aa0c00..86b5d750 100644 --- a/docs/section-2-using-parsers.md +++ b/docs/section-2-using-parsers.md @@ -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: