Interest in splitting off XPath as a separate/shared grammar subset? #16
eyelidlessness
started this conversation in
Ideas
Replies: 1 comment
-
Hi @eyelidlessness , sorry I missed this post, must check back more often. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I’ve recently been working on an XPath grammar, with some minor challenges around precedence/conflicts. I found your project yesterday and spent some time spiking into whether I could use the XPath subset, and how well it would work for my team’s current use cases. It’s pretty close! And closer still with a few minor tweaks I made in that spike.
There is some precedent to using a shared subset grammar between fully featured grammars—this is how tree-sitter-typescript supports both .ts and .tsx files. The difference here would be that XPath would also be usable as a standalone grammar, as well as embedded into XQuery.
If you’re open to this, I would be interested in contributing the change and offering to help maintain it. My team maintains several open source projects built around the XForms spec, and is also invested in helping to maintain several other projects in the ecosystem. I'm certain that we’d benefit from this, and would also be invested in contributing improvements/fixes.
We have an immediate use case: identifying sub-expression references to efficiently build a graph of dependent nodes in forms. For this I already have a fairly large set of test cases (and all but one passing as of yesterday!). We also could use this grammar to do more work in parsing expressions to evaluate extensions defined in the ODK XForms spec (an extension/subset of the W3C XForms spec). And we have quite a large set of test cases for that as well. These of course wouldn’t cover all of XQuery, but they could certainly help to tighten up the XPath subset!
If this doesn’t sound interesting, I can certainly fork (and would hope for your blessing in so doing), and offer PRs back-porting our improvements as I’m able. Either way, I look forward to hearing what you think!
Beta Was this translation helpful? Give feedback.
All reactions