Skip to content
This repository was archived by the owner on Jul 19, 2020. It is now read-only.
This repository was archived by the owner on Jul 19, 2020. It is now read-only.

Bring back {}, {*}, and {3} capture syntax for tuple structs/enums. #116

@hgzimmerman

Description

@hgzimmerman

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 one Vec<String> when matching, but would likely require a duplication of a lot of otherwise sharable logic as a downside.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthigh priorityIssues with this tag will be worked on before others

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions