kosen13s / tiny

A tiny programming language to improve kosen13s' skills
MIT License
4 stars 0 forks source link

Effective use of `ParseFailed` #6

Open Iruyan-Zak opened 7 years ago

Iruyan-Zak commented 7 years ago

Now, when parser1 <|> parser2 is failed to parse, the result becomes Left ParseFailed[reason1, reason2]. But if either of these consists of choice((<|>), choice), the result becomes a nest of ParseFailed []. It doesn't seem better method.

Does anyone be coming up with better way? (ParseFailed may be used for generating compilation errors. So I wish it be meaningful for it.)

Roadagain commented 7 years ago

well... concat ?