fix(lib): validate subtypes in supertype queries
This commit is contained in:
parent
bd02be25d5
commit
341665824c
4 changed files with 104 additions and 10 deletions
|
|
@ -115,6 +115,12 @@ match a `binary_expression` only if it is a child of `expression`:
|
|||
(expression/binary_expression) @binary-expression
|
||||
```
|
||||
|
||||
This also applies to anonymous nodes. For example, this pattern would match `"()"` only if it is a child of `expression`:
|
||||
|
||||
```query
|
||||
(expression/"()") @empty-expression
|
||||
```
|
||||
|
||||
[grammar]: ../../creating-parsers/3-writing-the-grammar.md#structuring-rules-well
|
||||
[node-field-names]: ../2-basic-parsing.md#node-field-names
|
||||
[named-vs-anonymous-nodes]: ../2-basic-parsing.md#named-vs-anonymous-nodes
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ see fit.
|
|||
|
||||
```query
|
||||
((comment) @injection.content
|
||||
(#lua-match? @injection.content "/[*\/][!*\/]<?[^a-zA-Z]")
|
||||
(#match? @injection.content "/[*\/][!*\/]<?[^a-zA-Z]")
|
||||
(#set! injection.language "doxygen"))
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue