The idea is that this can be useful for small repetitions such as separated sequencing, (item ~ comma)* ~ item? style.
If comma is silent, then Vec<item> works. If comma isn't silent, then you have to acknowledge it somehow; with this patch, you should be able to convert this as (Vec<(item, comma)>, Option<item>).
I'm thinking about how pest-ast can potentially expose this pattern. I'm thinking I'll want a "runtime" for pest-ast that has things like syn's Punctuated.
The idea is that this can be useful for small repetitions such as separated sequencing,
(item ~ comma)* ~ item?
style.If
comma
is silent, thenVec<item>
works. Ifcomma
isn't silent, then you have to acknowledge it somehow; with this patch, you should be able to convert this as(Vec<(item, comma)>, Option<item>)
.I'm thinking about how pest-ast can potentially expose this pattern. I'm thinking I'll want a "runtime" for pest-ast that has things like syn's
Punctuated
.