pest-parser / ast

Apache License 2.0
81 stars 15 forks source link

Provide `FromPest` impls for small tuples #7

Closed CAD97 closed 5 years ago

CAD97 commented 5 years ago

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.

CAD97 commented 5 years ago

bors: r+

CAD97 commented 5 years ago

Oh wait 😅