winnow-rs / winnow

Making parsing a breeze
https://docs.rs/winnow
Other
525 stars 40 forks source link

Support more `Fn` parser signatures using generics? #425

Closed epage closed 7 months ago

epage commented 8 months ago

See https://github.com/ElchananHaas/fabparse/blob/main/src/tag.rs

epage commented 7 months ago

In thinking through this, a very compelling case is being able to support Fn(Token) -> Option<O> because that could replace many uses of dispatch.

epage commented 7 months ago

Except, in reviewing this, only trivial escapes are helped. Usually an escape will need hex support which means this can't be used. I think I'll pass for now.