-
|
I'm trying to run this query against a parse tree with the following shape I get the following result which surprised me a bit; I didn't expect the Using anchoring I can reduce the result slightly gives Isn't this actually a bug? The first child should be captured in Some more questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
|
About:
What's worked for me is something like: FWIW, I leanred this via the invocation |
Beta Was this translation helpful? Give feedback.
-
|
Thanks, I was able to reproduce the behavior you reported. I noticed in the grammar that for flag_decl: $ => seq(
repeat($.comment),
'flag',
field('name', $.section_name),
field('properties', $.property_block),
),and the query in question uses both an anchor At the end of the Anchors section of the docs, I see this text:
I wonder if this is involved in the unexpected behavior. Sorry, the above may not really help with directly addressing your original point. |
Beta Was this translation helpful? Give feedback.
-
|
I think answers to all my questions, as well as a very workable solution to my problem, can be found above. Thus I'm closing this discussion. |
Beta Was this translation helpful? Give feedback.
Thanks, I was able to reproduce the behavior you reported.
I noticed in the grammar that for
flag_decl, there is an anonymous nodeflag:and the query in question uses both an anchor
.and the type of wildcard node_which matches both named and anonymous nodes:At the end of the Anchors section of the docs, I see this text:
I wonder if this is involved i…