aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-05-22 22:10:39 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-05-22 22:11:53 +0200
commit3f180e74d54ab447d3ef16ed5439e0abe8d1da97 (patch)
treecb7ceba41d6b2c589e4f0c1a44013928ebbea89d /src
parent8eb30e233b1f2627fcb4b1d59f6473efc19dfedd (diff)
Fix parser ('try' and numbers)
Diffstat (limited to 'src')
-rw-r--r--src/Haskell/Parser.hs6
1 files changed, 3 insertions, 3 deletions
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