diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2019-04-09 23:28:58 +0200 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2019-04-09 23:28:58 +0200 |
commit | b9494feebfabec0db65ee1b0e77cbd2d0d740470 (patch) | |
tree | a5715a3f720bfb5e394e502eb3f86ec9297b8af4 /src | |
parent | 8f742dc39085ebd15848ab32662239e8562a430c (diff) |
Fix parser (lambdas and quotes in names)
Diffstat (limited to 'src')
-rw-r--r-- | src/Haskell/Parser.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Haskell/Parser.hs b/src/Haskell/Parser.hs index dcee39e..41216d5 100644 --- a/src/Haskell/Parser.hs +++ b/src/Haskell/Parser.hs @@ -43,6 +43,7 @@ pExpr = pLam <|> pCase <|> pApp pLam = do symbolO "\\" args <- many1 pNameV + symbolO "->" body <- pExpr return $ Lam args body @@ -93,7 +94,7 @@ pNameT :: Parser Name pNameT = notReserved $ liftM2 (:) (satisfy isUpper) pNameRest pNameRest :: Parser Name -pNameRest = many (satisfy $ \d -> isAlphaNum d || d == '_') <* aheadW +pNameRest = many (satisfy $ \d -> isAlphaNum d || d `elem` "_'") <* aheadW notReserved :: Parser Name -> Parser Name notReserved p = @@ -120,7 +121,7 @@ symbolBare s = string s >> whitespace aheadW :: Parser () aheadW = do - void (lookAhead (space <|> satisfy (\d -> not (isAlphaNum d) && d /= '_'))) <|> eof + void (lookAhead (space <|> satisfy (\d -> not (isAlphaNum d) && d `notElem` "_'"))) <|> eof whitespace aheadO :: Parser () |