Given the grammar
Example:
Begin < AList
AList < A*
A <- 'a'
It would be nice to keep AList even for zero matches, given that 0 is a valid match. I expect something like
Example[0,0][]
+-Example.Begin[0,0][]
+-Example.AList[0,0][]
It is possible to achieve something like this by using '^AList', however, this also implies that all rules not defined in the grammar are kept, which creates unwanted noise. Moreover, since there is no way to halt the persistence, i.e. all child nodes share the same constraint, it causes even more noise when more than zero elements match.
Either all zero or more constraints would need to be kept in the final tree, which is probably undesired given the breaking change, or a new symbol that enforces the tagged rule, and only the tagged rule, to always be kept, could be added. Unless there is an intended and already implemented way of achieving this.
This affects constraints that can match with zero elements, meaning that the zero or one constraint would work similarly.
Edit: I didn't test this grammar. I think the description is simple enough to understand the desired outcome.
Given the grammar
It would be nice to keep
AListeven for zero matches, given that 0 is a valid match. I expect something likeIt is possible to achieve something like this by using '^AList', however, this also implies that all rules not defined in the grammar are kept, which creates unwanted noise. Moreover, since there is no way to halt the persistence, i.e. all child nodes share the same constraint, it causes even more noise when more than zero elements match.
Either all zero or more constraints would need to be kept in the final tree, which is probably undesired given the breaking change, or a new symbol that enforces the tagged rule, and only the tagged rule, to always be kept, could be added. Unless there is an intended and already implemented way of achieving this.
This affects constraints that can match with zero elements, meaning that the zero or one constraint would work similarly.
Edit: I didn't test this grammar. I think the description is simple enough to understand the desired outcome.