zesterer / chumsky

Write expressive, high-performance parsers with ease.
https://crates.io/crates/chumsky
MIT License
3.64k stars 155 forks source link

Changed `Or` path choosing #678

Closed KrosFire closed 1 week ago

KrosFire commented 1 month ago

resolves #677

The Or parser will now choose a path that succeeded first and if both fail it will try to figure out witch error is better suited

zesterer commented 1 month ago

Oh, this is for 0.9? Hmm...

I am somewhat less inclined to merge this because 0.9 is not maintained any longer, bar fixes for significant bugs. Is there a particular reason that you're using 0.9 instead of 1.0?

KrosFire commented 1 month ago

The first version is still in alpha and is not the default in cargo so I was using 0.9.3 :D

If I understand correctly the current implementation of Or in the main branch it's just a syntax sugar for choice, which returns first result that parses with success, so there is no need to change anything.

Is the newest version stable enough and does it have all the functionalities to use instead of 0.9? I'm looking forward to it because of the performence and dropping the Rc

zesterer commented 1 month ago

Is the newest version stable enough and does it have all the functionalities to use instead of 0.9?

I'd say so, yes. There are a few changes to come that are technically breaking, but only in the most abstract sense: Almost all real parsers written against 1.0-alpha should compile or compile with only very minor changes come 1.0 stable. The design is maybe 85% there, and the features that exist now aren't going anywhere. I'm avoiding a stable release for now purely because there are some minor API burrs still to sand down.