kdl icon indicating copy to clipboard operation
kdl copied to clipboard

KQL: Add pseudo-matchers (aka pseudo-classes)

Open zkat opened this issue 1 year ago • 0 comments

We should add support for pseudo-matchers that we can extend KQL with going forward. We can use the reserved # for the matcher keywords, so:

// select all `foo` nodes that do _not_ have a value.
foo#not([val()])

You can also chain them:

// Select all foo nodes without a value but only if they are the first children.
foo#not([val()])#first-child

We can then add support for tree-structural pseudo-matchers and functional pseudo-matchers.

This will of course increase implementation burden, but it'll also make KQL much more useful (and familiar).

zkat avatar Feb 12 '24 05:02 zkat