Mark parsing higher order tokens easier. (perhaps implement Compare for &[T] where T:Compare ?) #637
Labels
C-enhancement
Category: Raise on the bar on expectations
Milestone
Please complete the following tasks
winnow version
0.6.20
Describe your use case
I'm doing a small codecraft project with a language interpreter, and the design has multiple layers of parsing - string to tokens, and tokens to ast, etc.
It all works fine, but it is not very ergonomic:
To match [Token:X, Token:Y] I seem to need to do:
The ergonomics vs parsing strings are very vivid - there I could do
(any, "Y") or use literal() etc.
I cannot implement Compare, which literal depends on, as it hits the foreign type rule. For one_of, ContainsToken is sufficient.
What I would like to be able to write things like
Describe the solution you'd like
See the use case
Alternatives, if applicable
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: