diff options
Diffstat (limited to 'haddock-library/src/Documentation/Haddock/Parser')
-rw-r--r-- | haddock-library/src/Documentation/Haddock/Parser/Identifier.hs | 5 | ||||
-rw-r--r-- | haddock-library/src/Documentation/Haddock/Parser/Monad.hs | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/haddock-library/src/Documentation/Haddock/Parser/Identifier.hs b/haddock-library/src/Documentation/Haddock/Parser/Identifier.hs index b8afb951..4c56be9b 100644 --- a/haddock-library/src/Documentation/Haddock/Parser/Identifier.hs +++ b/haddock-library/src/Documentation/Haddock/Parser/Identifier.hs @@ -1,5 +1,4 @@ {-# LANGUAGE BangPatterns #-} -{-# LANGUAGE ViewPatterns #-} -- | -- Module : Documentation.Haddock.Parser.Identifier -- Copyright : (c) Alec Theriault 2019, @@ -150,9 +149,9 @@ takeIdentifier input = listToMaybe $ do | otherwise = Nothing -- | Parse all but the last quote off the front of the input - -- PRECONDITION: T.head t == '\'' + -- PRECONDITION: T.head t `elem` ['\'', '`'] quotes :: Text -> (Int, Text) - quotes t = let !n = T.length (T.takeWhile (== '\'') t) - 1 + quotes t = let !n = T.length (T.takeWhile (`elem` ['\'', '`']) t) - 1 in (n, T.drop n t) -- | Parse an operator off the front of the input diff --git a/haddock-library/src/Documentation/Haddock/Parser/Monad.hs b/haddock-library/src/Documentation/Haddock/Parser/Monad.hs index 2fa79961..8d6e7a1d 100644 --- a/haddock-library/src/Documentation/Haddock/Parser/Monad.hs +++ b/haddock-library/src/Documentation/Haddock/Parser/Monad.hs @@ -1,10 +1,8 @@ -{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE BangPatterns #-} -{-# LANGUAGE TypeSynonymInstances #-} -- | -- Module : Documentation.Haddock.Parser.Monad -- Copyright : (c) Alec Theriault 2018-2019, @@ -41,7 +39,7 @@ import Documentation.Haddock.Types ( Version ) import Prelude hiding (takeWhile) import CompatPrelude --- | The only bit of information we really care about truding along with us +-- | The only bit of information we really care about trudging along with us -- through parsing is the version attached to a @\@since@ annotation - if -- the doc even contained one. newtype ParserState = ParserState { |