20 lines
382 B
Haskell
20 lines
382 B
Haskell
|
module PDF.EOL (
|
||
|
Style(..)
|
||
|
, charset
|
||
|
, parser
|
||
|
) where
|
||
|
|
||
|
import Data.ByteString.Lazy.Char8 (ByteString)
|
||
|
import Text.Parsec ((<|>), Parsec, string, try)
|
||
|
|
||
|
data Style = CR | LF | CRLF
|
||
|
|
||
|
charset :: String
|
||
|
charset = "\r\n"
|
||
|
|
||
|
parser :: Parsec ByteString u Style
|
||
|
parser =
|
||
|
try (string "\r\n" >> return CRLF)
|
||
|
<|> (string "\r" >> return CR)
|
||
|
<|> (string "\n" >> return LF)
|