Rivest.hs 657 B

123456789101112131415161718192021222324252627282930
  1. module Data.SExpression.Rivest where
  2. import Data.ByteString (ByteString)
  3. import qualified Data.ByteString as BS
  4. import qualified Data.ByteString.Base64 as B64
  5. import Data.Text (Text)
  6. import qualified Data.Text as T
  7. newtype Atom = Atom { fromAtom :: ByteString } deriving (Eq, Show, Read)
  8. pToken :: Parser ByteString
  9. pToken = undefined
  10. pQuoted :: Maybe Int -> Parser ByteString
  11. pQuoted = do
  12. char '"'
  13. ss <- many1 quoteChar
  14. char '"'
  15. return ss
  16. pHex :: Parser ByteString
  17. pHex = undefined
  18. pVerbatim :: Int -> Parser ByteString
  19. pVerbatim = do
  20. char ':'
  21. take n
  22. pBase64Verbatim :: Parser ByteString
  23. pBase64 :: Parser ByteString