sparsec

simple Haskell parser combinator library
git clone git://git.rr3.xyz/sparsec
Log | Files | Refs | README | LICENSE

commit 18d3b0ad0d8f14a09eada01e9582b0456761e6f2
parent 188f7fc5e2ae60020080c02c95b48e7e0f49573b
Author: Robert Russell <robert@rr3.xyz>
Date:   Tue, 27 Aug 2024 02:32:44 -0700

Fix runWhileM following delete of lexM

Diffstat:
MSparsec.hs | 6+-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/Sparsec.hs b/Sparsec.hs @@ -300,11 +300,7 @@ charIf :: (Utf8Error e, Monad m) => (Char -> Bool) -> ParseT e m Char charIf want = charIfM (pure . want) runeWhileM :: (Utf8Error e, Monad m) => (Rune -> m Bool) -> ParseT e m ByteString -runeWhileM want = - fst <$> lexM () \((), r) -> - want r >>= \case - False -> pure $ LexRejectEmit () - True -> pure $ LexAcceptCont () +runeWhileM want = bytesOf $ many (runeIfM want) runeWhile :: (Utf8Error e, Monad m) => (Rune -> Bool) -> ParseT e m ByteString runeWhile want = runeWhileM (pure . want)