Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ghc-cassava-megaparsec for
openSUSE:Factory checked in at 2021-11-11 21:36:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-cassava-megaparsec (Old)
and /work/SRC/openSUSE:Factory/.ghc-cassava-megaparsec.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-cassava-megaparsec"
Thu Nov 11 21:36:16 2021 rev:6 rq:930313 version:2.0.4
Changes:
--------
---
/work/SRC/openSUSE:Factory/ghc-cassava-megaparsec/ghc-cassava-megaparsec.changes
2020-12-22 11:37:11.389363028 +0100
+++
/work/SRC/openSUSE:Factory/.ghc-cassava-megaparsec.new.1890/ghc-cassava-megaparsec.changes
2021-11-11 21:36:22.044886263 +0100
@@ -1,0 +2,12 @@
+Mon Nov 1 08:26:35 UTC 2021 - [email protected]
+
+- Update cassava-megaparsec to version 2.0.4.
+ ## Cassava Megaparsec 2.0.4
+
+ * Allow bytestring-0.11
+
+ ## Cassava Megaparsec 2.0.3
+
+ * Exposing Internals
+
+-------------------------------------------------------------------
Old:
----
cassava-megaparsec-2.0.2.tar.gz
New:
----
cassava-megaparsec-2.0.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-cassava-megaparsec.spec ++++++
--- /var/tmp/diff_new_pack.VDmkh0/_old 2021-11-11 21:36:22.456886563 +0100
+++ /var/tmp/diff_new_pack.VDmkh0/_new 2021-11-11 21:36:22.456886563 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-cassava-megaparsec
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%global pkg_name cassava-megaparsec
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 2.0.2
+Version: 2.0.4
Release: 0
Summary: Megaparsec parser of CSV files that plays nicely with Cassava
License: MIT
++++++ cassava-megaparsec-2.0.2.tar.gz -> cassava-megaparsec-2.0.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cassava-megaparsec-2.0.2/CHANGELOG.md
new/cassava-megaparsec-2.0.4/CHANGELOG.md
--- old/cassava-megaparsec-2.0.2/CHANGELOG.md 2020-09-11 15:46:45.000000000
+0200
+++ new/cassava-megaparsec-2.0.4/CHANGELOG.md 2021-10-21 23:07:13.000000000
+0200
@@ -1,3 +1,11 @@
+## Cassava Megaparsec 2.0.4
+
+* Allow bytestring-0.11
+
+## Cassava Megaparsec 2.0.3
+
+* Exposing Internals
+
## Cassava Megaparsec 2.0.2
* Add suppport for `megaparsec-9.0.0`
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/cassava-megaparsec-2.0.2/Data/Csv/Parser/Megaparsec/Internals.hs
new/cassava-megaparsec-2.0.4/Data/Csv/Parser/Megaparsec/Internals.hs
--- old/cassava-megaparsec-2.0.2/Data/Csv/Parser/Megaparsec/Internals.hs
1970-01-01 01:00:00.000000000 +0100
+++ new/cassava-megaparsec-2.0.4/Data/Csv/Parser/Megaparsec/Internals.hs
2021-10-21 23:04:51.000000000 +0200
@@ -0,0 +1,173 @@
+-- |
+-- Module : Data.Csv.Parser.Megaparsec.Internals
+-- Copyright : ?? 2016???2021 Stack Builders
+-- License : MIT
+--
+
+{-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+
+module Data.Csv.Parser.Megaparsec.Internals
+ ( ConversionError (..)
+ , Parser
+ , csv
+ , csvWithHeader
+ , decodeWithC
+ , toNamedRecord
+ , header
+ , name
+ , record
+ , field
+ , escapedField
+ , unescapedField)
+where
+
+import Control.Monad
+import Data.ByteString (ByteString)
+import Data.Csv hiding
+ ( Parser
+ , record
+ , header
+ , toNamedRecord )
+import Data.Data
+import Data.Vector (Vector)
+import Data.Word (Word8)
+import Text.Megaparsec
+import Text.Megaparsec.Byte
+import qualified Data.ByteString as B
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.Csv as C
+import qualified Data.HashMap.Strict as H
+import qualified Data.Vector as V
+
+----------------------------------------------------------------------------
+-- Custom error component and other types
+
+-- | Custom error component for CSV parsing. It allows typed reporting of
+-- conversion errors.
+
+newtype ConversionError = ConversionError String
+ deriving (Eq, Data, Typeable, Ord, Read, Show)
+
+instance ShowErrorComponent ConversionError where
+ showErrorComponent (ConversionError msg) =
+ "conversion error: " ++ msg
+
+-- | Parser type that uses ???custom error component??? 'ConversionError'.
+
+type Parser = Parsec ConversionError BL.ByteString
+
+----------------------------------------------------------------------------
+-- The parser
+
+-- | Parse a CSV file that does not include a header.
+
+csv :: FromRecord a
+ => DecodeOptions -- ^ Decoding options
+ -> Parser (Vector a) -- ^ The parser that parses collection of records
+csv DecodeOptions {..} = do
+ xs <- sepEndBy1 (record decDelimiter parseRecord) eol
+ eof
+ return $! V.fromList xs
+
+-- | Parse a CSV file that includes a header.
+
+csvWithHeader :: FromNamedRecord a
+ => DecodeOptions -- ^ Decoding options
+ -> Parser (Header, Vector a)
+ -- ^ The parser that parser collection of named records
+csvWithHeader DecodeOptions {..} = do
+ !hdr <- header decDelimiter
+ let f = parseNamedRecord . toNamedRecord hdr
+ xs <- sepEndBy1 (record decDelimiter f) eol
+ eof
+ return $ let !v = V.fromList xs in (hdr, v)
+
+-- | Decode CSV data using the provided parser, skipping a leading header if
+-- necessary.
+
+decodeWithC
+ :: (DecodeOptions -> Parser a)
+ -- ^ Parsing function parametrized by 'DecodeOptions'
+ -> DecodeOptions
+ -- ^ Decoding options
+ -> HasHeader
+ -- ^ Whether to expect a header in the input
+ -> FilePath
+ -- ^ File name (only for displaying in parse error messages, use empty
+ -- string if you have none)
+ -> BL.ByteString
+ -- ^ CSV data
+ -> Either (ParseErrorBundle BL.ByteString ConversionError) a
+decodeWithC p opts@DecodeOptions {..} hasHeader = parse parser
+ where
+ parser = case hasHeader of
+ HasHeader -> header decDelimiter *> p opts
+ NoHeader -> p opts
+{-# INLINE decodeWithC #-}
+
+-- | Convert a 'Record' to a 'NamedRecord' by attaching column names. The
+-- 'Header' and 'Record' must be of the same length.
+
+toNamedRecord :: Header -> Record -> NamedRecord
+toNamedRecord hdr v = H.fromList . V.toList $ V.zip hdr v
+{-# INLINE toNamedRecord #-}
+
+-- | Parse a header, including the terminating line separator.
+
+header :: Word8 -> Parser Header
+header del = V.fromList <$!> p <* eol
+ where
+ p = sepBy1 (name del) (void $ char del) <?> "file header"
+{-# INLINE header #-}
+
+-- | Parse a header name. Header names have the same format as regular
+-- 'field's.
+
+name :: Word8 -> Parser Name
+name del = field del <?> "name in header"
+{-# INLINE name #-}
+
+-- | Parse a record, not including the terminating line separator. The
+-- terminating line separate is not included as the last record in a CSV
+-- file is allowed to not have a terminating line separator.
+
+record
+ :: Word8 -- ^ Field delimiter
+ -> (Record -> C.Parser a)
+ -- ^ How to ???parse??? record to get the data of interest
+ -> Parser a
+record del f = do
+ notFollowedBy eof -- to prevent reading empty line at the end of file
+ r <- V.fromList <$!> (sepBy1 (field del) (void $ char del) <?> "record")
+ case C.runParser (f r) of
+ Left msg -> customFailure (ConversionError msg)
+ Right x -> return x
+{-# INLINE record #-}
+
+-- | Parse a field. The field may be in either the escaped or non-escaped
+-- format. The returned value is unescaped.
+
+field :: Word8 -> Parser Field
+field del = label "field" (escapedField <|> unescapedField del)
+{-# INLINE field #-}
+
+-- | Parse an escaped field.
+
+escapedField :: Parser ByteString
+escapedField =
+ B.pack <$!> between (char 34) (char 34) (many $ normalChar <|> escapedDq)
+ where
+ normalChar = anySingleBut 34 <?> "unescaped character"
+ escapedDq = label "escaped double-quote" (34 <$ string "\"\"")
+{-# INLINE escapedField #-}
+
+-- | Parse an unescaped field.
+
+unescapedField :: Word8 -> Parser ByteString
+unescapedField del = BL.toStrict <$> takeWhileP (Just "unescaped character") f
+ where
+ f x = x /= del && x /= 34 && x /= 10 && x /= 13
+{-# INLINE unescapedField #-}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/cassava-megaparsec-2.0.2/Data/Csv/Parser/Megaparsec.hs
new/cassava-megaparsec-2.0.4/Data/Csv/Parser/Megaparsec.hs
--- old/cassava-megaparsec-2.0.2/Data/Csv/Parser/Megaparsec.hs 2020-09-10
14:11:41.000000000 +0200
+++ new/cassava-megaparsec-2.0.4/Data/Csv/Parser/Megaparsec.hs 2021-10-21
23:04:51.000000000 +0200
@@ -1,6 +1,6 @@
-- |
-- Module : Data.Csv.Parser.Megaparsec
--- Copyright : ?? 2016???2018 Stack Builders
+-- Copyright : ?? 2016???2021 Stack Builders
-- License : MIT
--
-- Maintainer : Mark Karpov <[email protected]>
@@ -19,58 +19,27 @@
-- The parser provides better error messages than the parser that comes with
-- Cassava library, while being compatible with the rest of the library.
-{-# LANGUAGE BangPatterns #-}
-{-# LANGUAGE DeriveDataTypeable #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RecordWildCards #-}
-
module Data.Csv.Parser.Megaparsec
( ConversionError (..)
, decode
, decodeWith
, decodeByName
- , decodeByNameWith )
+ , decodeByNameWith)
where
-import Control.Monad
-import Data.ByteString (ByteString)
import Data.Csv hiding
- ( Parser
- , record
- , namedRecord
- , header
- , toNamedRecord
- , decode
+ ( decode
, decodeWith
, decodeByName
, decodeByNameWith )
-import Data.Data
import Data.Vector (Vector)
-import Data.Word (Word8)
import Text.Megaparsec
-import Text.Megaparsec.Byte
-import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
-import qualified Data.Csv as C
-import qualified Data.HashMap.Strict as H
-import qualified Data.Vector as V
-
-----------------------------------------------------------------------------
--- Custom error component and other types
-
--- | Custom error component for CSV parsing. It allows typed reporting of
--- conversion errors.
-
-newtype ConversionError = ConversionError String
- deriving (Eq, Data, Typeable, Ord, Read, Show)
-
-instance ShowErrorComponent ConversionError where
- showErrorComponent (ConversionError msg) =
- "conversion error: " ++ msg
-
--- | Parser type that uses ???custom error component??? 'ConversionError'.
-
-type Parser = Parsec ConversionError BL.ByteString
+import Data.Csv.Parser.Megaparsec.Internals
+ ( ConversionError (..)
+ , csv
+ , csvWithHeader
+ , decodeWithC)
----------------------------------------------------------------------------
-- Top level interface
@@ -134,117 +103,4 @@
-- ^ CSV data
-> Either (ParseErrorBundle BL.ByteString ConversionError) (Header, Vector a)
decodeByNameWith opts = parse (csvWithHeader opts)
-{-# INLINE decodeByNameWith #-}
-
--- | Decode CSV data using the provided parser, skipping a leading header if
--- necessary.
-
-decodeWithC
- :: (DecodeOptions -> Parser a)
- -- ^ Parsing function parametrized by 'DecodeOptions'
- -> DecodeOptions
- -- ^ Decoding options
- -> HasHeader
- -- ^ Whether to expect a header in the input
- -> FilePath
- -- ^ File name (only for displaying in parse error messages, use empty
- -- string if you have none)
- -> BL.ByteString
- -- ^ CSV data
- -> Either (ParseErrorBundle BL.ByteString ConversionError) a
-decodeWithC p opts@DecodeOptions {..} hasHeader = parse parser
- where
- parser = case hasHeader of
- HasHeader -> header decDelimiter *> p opts
- NoHeader -> p opts
-{-# INLINE decodeWithC #-}
-
-----------------------------------------------------------------------------
--- The parser
-
--- | Parse a CSV file that does not include a header.
-
-csv :: FromRecord a
- => DecodeOptions -- ^ Decoding options
- -> Parser (Vector a) -- ^ The parser that parses collection of records
-csv DecodeOptions {..} = do
- xs <- sepEndBy1 (record decDelimiter parseRecord) eol
- eof
- return $! V.fromList xs
-
--- | Parse a CSV file that includes a header.
-
-csvWithHeader :: FromNamedRecord a
- => DecodeOptions -- ^ Decoding options
- -> Parser (Header, Vector a)
- -- ^ The parser that parser collection of named records
-csvWithHeader DecodeOptions {..} = do
- !hdr <- header decDelimiter
- let f = parseNamedRecord . toNamedRecord hdr
- xs <- sepEndBy1 (record decDelimiter f) eol
- eof
- return $ let !v = V.fromList xs in (hdr, v)
-
--- | Convert a 'Record' to a 'NamedRecord' by attaching column names. The
--- 'Header' and 'Record' must be of the same length.
-
-toNamedRecord :: Header -> Record -> NamedRecord
-toNamedRecord hdr v = H.fromList . V.toList $ V.zip hdr v
-{-# INLINE toNamedRecord #-}
-
--- | Parse a header, including the terminating line separator.
-
-header :: Word8 -> Parser Header
-header del = V.fromList <$!> p <* eol
- where
- p = sepBy1 (name del) (void $ char del) <?> "file header"
-{-# INLINE header #-}
-
--- | Parse a header name. Header names have the same format as regular
--- 'field's.
-
-name :: Word8 -> Parser Name
-name del = field del <?> "name in header"
-{-# INLINE name #-}
-
--- | Parse a record, not including the terminating line separator. The
--- terminating line separate is not included as the last record in a CSV
--- file is allowed to not have a terminating line separator.
-
-record
- :: Word8 -- ^ Field delimiter
- -> (Record -> C.Parser a)
- -- ^ How to ???parse??? record to get the data of interest
- -> Parser a
-record del f = do
- notFollowedBy eof -- to prevent reading empty line at the end of file
- r <- V.fromList <$!> (sepBy1 (field del) (void $ char del) <?> "record")
- case C.runParser (f r) of
- Left msg -> customFailure (ConversionError msg)
- Right x -> return x
-{-# INLINE record #-}
-
--- | Parse a field. The field may be in either the escaped or non-escaped
--- format. The returned value is unescaped.
-
-field :: Word8 -> Parser Field
-field del = label "field" (escapedField <|> unescapedField del)
-{-# INLINE field #-}
-
--- | Parse an escaped field.
-
-escapedField :: Parser ByteString
-escapedField =
- B.pack <$!> between (char 34) (char 34) (many $ normalChar <|> escapedDq)
- where
- normalChar = anySingleBut 34 <?> "unescaped character"
- escapedDq = label "escaped double-quote" (34 <$ string "\"\"")
-{-# INLINE escapedField #-}
-
--- | Parse an unescaped field.
-
-unescapedField :: Word8 -> Parser ByteString
-unescapedField del = BL.toStrict <$> takeWhileP (Just "unescaped character") f
- where
- f x = x /= del && x /= 34 && x /= 10 && x /= 13
-{-# INLINE unescapedField #-}
+{-# INLINE decodeByNameWith #-}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cassava-megaparsec-2.0.2/LICENSE.md
new/cassava-megaparsec-2.0.4/LICENSE.md
--- old/cassava-megaparsec-2.0.2/LICENSE.md 2020-09-10 14:11:41.000000000
+0200
+++ new/cassava-megaparsec-2.0.4/LICENSE.md 2021-10-21 23:04:51.000000000
+0200
@@ -1,6 +1,6 @@
# MIT License
-Copyright ?? 2016???2018 Stack Builders
+Copyright ?? 2016???2021 Stack Builders
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cassava-megaparsec-2.0.2/README.md
new/cassava-megaparsec-2.0.4/README.md
--- old/cassava-megaparsec-2.0.2/README.md 2020-09-10 14:11:41.000000000
+0200
+++ new/cassava-megaparsec-2.0.4/README.md 2021-10-21 23:04:51.000000000
+0200
@@ -60,6 +60,6 @@
## License
-Copyright ?? 2016???2018 Stack Builders
+Copyright ?? 2016???2021 Stack Builders
Distributed under MIT license.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cassava-megaparsec-2.0.2/cassava-megaparsec.cabal
new/cassava-megaparsec-2.0.4/cassava-megaparsec.cabal
--- old/cassava-megaparsec-2.0.2/cassava-megaparsec.cabal 2020-09-11
15:46:45.000000000 +0200
+++ new/cassava-megaparsec-2.0.4/cassava-megaparsec.cabal 2021-10-21
23:07:13.000000000 +0200
@@ -1,5 +1,5 @@
name: cassava-megaparsec
-version: 2.0.2
+version: 2.0.4
cabal-version: 1.18
tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.3,
GHC==8.6.1
license: MIT
@@ -26,12 +26,13 @@
library
build-depends: base >= 4.8 && < 5.0
- , bytestring >= 0.9 && < 0.11
+ , bytestring >= 0.9 && < 0.12
, cassava >= 0.4.2 && < 0.6
, megaparsec >= 7.0 && < 10.0
, unordered-containers >= 0.2.7 && < 0.3
, vector >= 0.11 && < 0.13
exposed-modules: Data.Csv.Parser.Megaparsec
+ , Data.Csv.Parser.Megaparsec.Internals
if flag(dev)
ghc-options: -Wall -Werror
else
@@ -49,7 +50,7 @@
hs-source-dirs: tests
type: exitcode-stdio-1.0
build-depends: base >= 4.8 && < 5.0
- , bytestring >= 0.9 && < 0.11
+ , bytestring >= 0.9 && < 0.12
, cassava >= 0.4.2 && < 0.6
, cassava-megaparsec
, hspec >= 2.0 && < 3.0