summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikitaVolkov <>2018-09-14 01:47:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-09-14 01:47:00 (GMT)
commit51276a4b852714a76d9005538c0a2208eb9eb61d (patch)
treeb7dbf1ae2779bb3407007ca4120c28453b47bcfa
parent5e0ba109b4dcede696d9103ccc58199bfbbc5089 (diff)
version 0.3.2.4HEAD0.3.2.4master
-rw-r--r--library/NeatInterpolation/Parsing.hs23
-rw-r--r--neat-interpolation.cabal2
2 files changed, 3 insertions, 22 deletions
diff --git a/library/NeatInterpolation/Parsing.hs b/library/NeatInterpolation/Parsing.hs
index 6fc664a..d3933d5 100644
--- a/library/NeatInterpolation/Parsing.hs
+++ b/library/NeatInterpolation/Parsing.hs
@@ -1,6 +1,3 @@
-{-# LANGUAGE CPP #-}
-{-# LANGUAGE EmptyCase #-}
-
module NeatInterpolation.Parsing where
import BasePrelude hiding (many, some, try, (<|>))
@@ -17,22 +14,6 @@ data LineContent =
LineContentIdentifier [Char]
deriving (Show)
-#if ( __GLASGOW_HASKELL__ < 710 )
-data Void
-
-instance Eq Void where
- _ == _ = True
-
-instance Ord Void where
- compare _ _ = EQ
-
-instance ShowErrorComponent Void where
- showErrorComponent = absurd
-
-absurd :: Void -> a
-absurd a = case a of {}
-#endif
-
type Parser = Parsec Void String
-- | Pretty parse exception for parsing lines.
@@ -41,7 +22,7 @@ newtype ParseException = ParseException Text
parseLines :: [Char] -> Either ParseException [Line]
parseLines input = case parse lines "NeatInterpolation.Parsing.parseLines" input of
- Left err -> Left $ ParseException $ pack $ parseErrorPretty' input err
+ Left err -> Left $ ParseException $ pack $ errorBundlePretty err
Right output -> Right output
where
lines :: Parser [Line]
@@ -54,7 +35,7 @@ parseLines input = case parse lines "NeatInterpolation.Parsing.parseLines" input
escapedDollar = fmap LineContentText $ char '$' *> count 1 (char '$')
identifier' = some (alphaNumChar <|> char '\'' <|> char '_')
contentText = do
- text <- manyTill anyChar end
+ text <- manyTill anySingle end
if null text
then fail "Empty text"
else return $ LineContentText $ text
diff --git a/neat-interpolation.cabal b/neat-interpolation.cabal
index 896d741..e9edbd3 100644
--- a/neat-interpolation.cabal
+++ b/neat-interpolation.cabal
@@ -1,7 +1,7 @@
name:
neat-interpolation
version:
- 0.3.2.3
+ 0.3.2.4
synopsis:
A quasiquoter for neat and simple multiline text interpolation
description: