You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm thinking about using esquery for matching some pretty deeply nested constructs. I need to differentiate between eg. the object and property of a MemberExpression, so I cannot use the child selector, as it will match a child in either position:
I know that I drop into "attribute mode" and achieve what I need using a query like:
MemberExpression[property.name=foo]
... but since the asts I need to match are much deeper than that, it would be really awkward to have to spell out the rest of the subtree like that with lots of repeated [property.foo.bar=123][property.foo.quux=abc]. It would be much nicer if I could use something like the > selector to cover the nesting aspects.
Am I overlooking a nice way to achieve that?
The text was updated successfully, but these errors were encountered:
Oh, turns out this is exactly what the "field" selector is supposed to do. I didn't understand that when I first tried because the subject indicator bug (#60) caused me to get the wrong nodes. I tried switching to jupenur's fork, and now everything seems to work as described.
Hi, I'm thinking about using esquery for matching some pretty deeply nested constructs. I need to differentiate between eg. the
object
andproperty
of aMemberExpression
, so I cannot use the child selector, as it will match a child in either position:I know that I drop into "attribute mode" and achieve what I need using a query like:
... but since the asts I need to match are much deeper than that, it would be really awkward to have to spell out the rest of the subtree like that with lots of repeated
[property.foo.bar=123][property.foo.quux=abc]
. It would be much nicer if I could use something like the>
selector to cover the nesting aspects.Am I overlooking a nice way to achieve that?
The text was updated successfully, but these errors were encountered: