masala-parser icon indicating copy to clipboard operation
masala-parser copied to clipboard

F.tryAll()

Open nicolas-zozol opened this issue 5 years ago • 4 comments
trafficstars

Instead of F.try(F.try(x).or(y)).or(z) or F.try(x).or(F.try(y)).orz(), we could use F.tryAll(x, y, z)

nicolas-zozol avatar Nov 10 '20 21:11 nicolas-zozol

The parser try(x.or(y)).or(z) is enough. In your proposition, You mix Try and Or in the same construction and I think this is error-prone.

d-plaindoux avatar Nov 12 '20 07:11 d-plaindoux

No pull request?

d-plaindoux avatar Nov 12 '20 08:11 d-plaindoux

Oups :smile: Let me revert that. I will make the tryAll snippet in the documentation so that people can use it if they like. Personally, I prefer it for the kind of job I do. But you are right, it's way better to keep this low-level, well separated.

nicolas-zozol avatar Nov 12 '20 08:11 nicolas-zozol

As there is very few development, I tend to push on dev and make the PR on master

nicolas-zozol avatar Nov 12 '20 08:11 nicolas-zozol