Tree-sitter Query Syntax
https://tree-sitter.github.io/tree-sitter/using-parsers/queries/1-syntax.html
#tree-sitter_query
A query consists of one or more patterns, where each pattern is an S-expression that matches a certain set of nodes in a syntax tree.
For example, this pattern would match any binary_expression node whose children are both number_literal nodes:
(binary_expression (number_literal) (number_literal))
field name
Node Field Names https://tree-sitter.github.io/tree-sitter/using-parsers/2-basic-parsing.html#node-field-names
You do this by prefixing a child pattern with a field name followed by a colon.
! (negate)
You can also constrain a pattern so that it only matches nodes that lack a certain field.
Anonymous Nodes
The parenthesized syntax for writing nodes only applies to named nodes. To match specific anonymous nodes, you write their name between double quotes.