This repository has been archived by the owner on Jul 19, 2020. It is now read-only.
Bring back {}, {*}, and {3} capture syntax for tuple structs/enums. #116
Labels
enhancement
New feature or request
high priority
Issues with this tag will be worked on before others
Description
Currently, the same syntax is used for both tuple-structs and normal structs,and unit structs.
The current implementation requires a name for each capture group, even though they aren't used for tuple-structs. A superset of the syntax could be introduced to support tuples, allowing both unnamed and named variations on the
{}
syntax.To keep the implementations similar, a parameter or or type parameter could be provided to the frontend parser function.
The MatcherToken could get a superset copy of itself, or could be expanded to hold both. The advantage of keeping them separate, is that one could only produce
Captures
and the other oneVec<String>
when matching, but would likely require a duplication of a lot of otherwise sharable logic as a downside.The text was updated successfully, but these errors were encountered: