From 060467bcc4e11628df1873831bde851f4dd5f21b Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Wed, 10 Jan 2024 06:26:43 +0100 Subject: [PATCH] Testing the integer parser. --- src/Main.purs | 5 +++++ src/Parser.purs | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Main.purs b/src/Main.purs index 786db45..bc57add 100644 --- a/src/Main.purs +++ b/src/Main.purs @@ -52,6 +52,11 @@ main = do Just (Tuple x y) -> show x <> " " <> show y Nothing -> "failed" + log $ "parsing integer in '-19ab' (integer): " <> + case parse integer "-19ab" of + Just (Tuple x y) -> show x <> " " <> show y + Nothing -> "failed" + -- JUST WORKS -- isffound $ parse isf "fable" -- isffound $ parse isf "f" diff --git a/src/Parser.purs b/src/Parser.purs index f98dad7..176a205 100644 --- a/src/Parser.purs +++ b/src/Parser.purs @@ -131,8 +131,6 @@ int = do _ <- char '-' pure (-n) <|> nat --- Handling spacing - isSpace :: Char -> Boolean isSpace c = A.any (\v -> v == c) [' ', '\t', ' ', '\r', '\n']