diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2022-10-18 22:10:14 -0700 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2022-10-18 22:10:16 -0700 |
| commit | be2f946e8fc8fb515aca5970cf80c189adbfcf89 (patch) | |
| tree | b29ed7da8c150f8732bd28c94eaa217caf7a119d /src/Text | |
| parent | bc91e4a8efd99259b49f94c7e2d26294da7eb6d9 (diff) | |
T.P.Sources: UpdateSourcePos instances for String and...
strict and lazy ByteString. [API change]
Diffstat (limited to 'src/Text')
| -rw-r--r-- | src/Text/Pandoc/Sources.hs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Sources.hs b/src/Text/Pandoc/Sources.hs index f17e566c9..69dc42812 100644 --- a/src/Text/Pandoc/Sources.hs +++ b/src/Text/Pandoc/Sources.hs @@ -46,6 +46,8 @@ import Text.Parsec (Stream(..), ParsecT) import Text.Parsec.Pos as P import Data.Text (Text) import qualified Data.Text as T +import qualified Data.ByteString as BS +import qualified Data.ByteString.Lazy as BL import Data.Char (isSpace, isLetter, isAlphaNum, isDigit, isHexDigit) import Data.String (IsString(..)) import qualified Data.List.NonEmpty as NonEmpty @@ -112,6 +114,15 @@ class UpdateSourcePos s c where instance UpdateSourcePos Text Char where updateSourcePos pos c _ = updatePosChar pos c +instance UpdateSourcePos [Char] Char where + updateSourcePos pos c _ = updatePosChar pos c + +instance UpdateSourcePos BS.ByteString Char where + updateSourcePos pos c _ = updatePosChar pos c + +instance UpdateSourcePos BL.ByteString Char where + updateSourcePos pos c _ = updatePosChar pos c + instance UpdateSourcePos Sources Char where updateSourcePos pos c sources = case sources of |
