From 3f180e74d54ab447d3ef16ed5439e0abe8d1da97 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Fri, 22 May 2020 22:10:39 +0200 Subject: Fix parser ('try' and numbers) --- src/Haskell/Parser.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Haskell/Parser.hs b/src/Haskell/Parser.hs index 41216d5..bd10705 100644 --- a/src/Haskell/Parser.hs +++ b/src/Haskell/Parser.hs @@ -79,7 +79,7 @@ pLargePat = choice [PatCon <$> pNameT <*> many pSimplePat pNum :: Parser Integer pNum = (char '-' >> (negate <$> pPositive)) <|> pPositive - where pPositive = read <$> many1 digit + where pPositive = read <$> many1 digit <* aheadW pVariable :: Parser Name pVariable = pName <|> try (parens pOperator) @@ -111,10 +111,10 @@ braces :: Parser a -> Parser a braces = between (symbolBare "{") (symbolBare "}") symbolW :: String -> Parser () -symbolW s = string s >> aheadW +symbolW s = try (string s >> aheadW) symbolO :: String -> Parser () -symbolO s = string s >> aheadO +symbolO s = try (string s >> aheadO) symbolBare :: String -> Parser () symbolBare s = string s >> whitespace -- cgit v1.2.3-70-g09d2