pointfreeco / swift-parsing

A library for turning nebulous data into well-structured data, with a focus on composition, performance, generality, and ergonomics.
https://www.pointfree.co/collections/parsing
MIT License
864 stars 77 forks source link

Downstream ParseBuilder should use Downstream.Input as Input #291

Closed KaiOelfke closed 1 year ago

KaiOelfke commented 1 year ago

I'm currently trying to migrate some parsing code to the 5.8 branch. I think I found a bug, but it could also be a misunderstanding with the latest changes.

The ParseBuilder is for Downstream so it should use it’s input. Or Upstream.Output as pipe runs the downstream parser on the output of the upstream parser. Which is why Upstream.Output == Downstream.Input.

With the 5.8 changes pipe uses the wrong input here. This only causes issues, if Upstream and Downstream have a different Input type.

The test can probably be simplified.

stephencelis commented 1 year ago

Thanks!