kdl-org / kdl

the kdl document language specifications
https://kdl.dev
Other
1.12k stars 62 forks source link

kql: only allow top() at start of selector #388

Closed alightgoesout closed 5 months ago

alightgoesout commented 5 months ago

Following discussion #387, I propose a change to the KQL grammar. With this change, top() will only be allowed at the start of a KQL selector.

zkat commented 5 months ago

Maybe we can add some explanatory text as well, to clarify that top() is toplevel only, not just put it in the grammar?

alightgoesout commented 5 months ago

Yes you're right, I have added an explanation.

zkat commented 5 months ago

lgtm, I'll let @larsgw have an eyeball at it since he was part of our discussion, too.

larsgw commented 5 months ago

I'd rather have selector and selector-subsequent so that the main selector rule is called selector and not selector-start, that makes it slightly easier to translate to a grammar. Otherwise, lgtm.

alightgoesout commented 5 months ago

I have renamed the rules as suggested.