sparsec

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

commit 87d564ed328d147683c3ed92a5ecbe762c5ddad0
parent b605abfa8d626066e5953e59a6ec3ab78b99b8b2
Author: Robert Russell <robert@rr3.xyz>
Date:   Sun, 21 Dec 2025 23:44:44 -0800

Also inline class methods

Diffstat:
Mexample/Main.hs | 7++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/example/Main.hs b/example/Main.hs @@ -52,10 +52,7 @@ data Prog = Prog [Decl] Stmt deriving (Show) -------------------------------------------------------------------------------- -- Parser -data Err = ErrUtf8 P.Loc | Err deriving (Show) -- TODO - -instance P.Utf8Error Err where - utf8Error = ErrUtf8 +data Err = Err deriving (Show) -- TODO type P a = P.Parse Err a @@ -65,7 +62,7 @@ isWordCont c = isLetterOrDigit c || c == '_' || c == '\'' isKw s = s == "data" || s == "prd" || s == "cns" -pWs = P.charWhile isSpace +pWs = P.many_ (P.charIf isSpace) pToken p = p <* pWs pSym = pToken . P.string pWord = snd <$> (P.bytesOf $ P.charIf isWordStart *> P.charWhile isWordCont)