Skip to content

Commit

Permalink
In onceAndConsumeTill try end parser or consume a char. Try is needed…
Browse files Browse the repository at this point in the history
… because <|> does not trigger is end consumed input
  • Loading branch information
tmspzz committed Apr 7, 2017
1 parent c02df6e commit 413cdd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Text/Parsec/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ onceAndConsumeTill :: (Parsec.Stream s Identity Char)
-> Parsec.Parsec s u (Maybe a)
onceAndConsumeTill p end = Parsec.optionMaybe (Parsec.try p) <* consume
where
consume = do { end; return () } <|> Parsec.anyChar *> consume
consume = Parsec.try end <|> Parsec.anyChar *> consume

0 comments on commit 413cdd0

Please sign in to comment.