diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-07-20 15:54:57 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-07-20 15:54:57 -0700 |
commit | 2c30c4875727c530677b2689178a227e6be0288a (patch) | |
tree | bb5135133989d68a301067a487e5cfc25444ee66 /src/Text/Pandoc/Biblio.hs | |
parent | 5085962c28aa35394c567da360fd065dc3bbd0e0 (diff) | |
download | pandoc-2c30c4875727c530677b2689178a227e6be0288a.tar.gz |
Use Parser as type synonym for Parsec.
Diffstat (limited to 'src/Text/Pandoc/Biblio.hs')
-rw-r--r-- | src/Text/Pandoc/Biblio.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Biblio.hs b/src/Text/Pandoc/Biblio.hs index 95787fdb4..b4afe5117 100644 --- a/src/Text/Pandoc/Biblio.hs +++ b/src/Text/Pandoc/Biblio.hs @@ -165,7 +165,7 @@ locatorWords inp = breakup (x : xs) = x : breakup xs splitup = groupBy (\x y -> x /= '\160' && y /= '\160') -pLocatorWords :: Parsec [Inline] st (String, [Inline]) +pLocatorWords :: Parser [Inline] st (String, [Inline]) pLocatorWords = do l <- pLocator s <- getInput -- rest is suffix @@ -173,16 +173,16 @@ pLocatorWords = do then return (init l, Str "," : s) else return (l, s) -pMatch :: (Inline -> Bool) -> Parsec [Inline] st Inline +pMatch :: (Inline -> Bool) -> Parser [Inline] st Inline pMatch condition = try $ do t <- anyToken guard $ condition t return t -pSpace :: Parsec [Inline] st Inline +pSpace :: Parser [Inline] st Inline pSpace = pMatch (\t -> t == Space || t == Str "\160") -pLocator :: Parsec [Inline] st String +pLocator :: Parser [Inline] st String pLocator = try $ do optional $ pMatch (== Str ",") optional pSpace @@ -190,7 +190,7 @@ pLocator = try $ do gs <- many1 pWordWithDigits return $ stringify f ++ (' ' : unwords gs) -pWordWithDigits :: Parsec [Inline] st String +pWordWithDigits :: Parser [Inline] st String pWordWithDigits = try $ do pSpace r <- many1 (notFollowedBy pSpace >> anyToken) |