Marwes / combine

A parser combinator library for Rust
https://docs.rs/combine/*/combine/
MIT License
1.29k stars 93 forks source link

Docs unclear whether `parser!` should be used on nightly rust #352

Closed spencerwhite closed 2 years ago

spencerwhite commented 2 years ago

According to this page, parser! isn't necessary on nightly rust since you can use impl Parser<...> instead. It points to this file as an example, but this line uses parser!.

I'm not completely opposed to macros, but it would be really nice to not have to use them.

Marwes commented 2 years ago

impl Parser can be used for most parsers regardless of whether you use stable or nightly now (the comment is outdated). However you do need to use parser! or opaque! to construct parsers which contain itself to prevent the impl Parser type from containing itself (which is impossible). https://github.com/Marwes/combine/blob/24be5aba070b8bd36730128e26e474fc4810d446/benches/json.rs#L165-L166

spencerwhite commented 2 years ago

Alright, thanks