Hello community, here is the log from the commit of package ghc-doctemplates for openSUSE:Factory checked in at 2018-05-30 12:06:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-doctemplates (Old) and /work/SRC/openSUSE:Factory/.ghc-doctemplates.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-doctemplates" Wed May 30 12:06:59 2018 rev:3 rq:607787 version:0.2.2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-doctemplates/ghc-doctemplates.changes 2017-09-15 21:36:28.655005465 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-doctemplates.new/ghc-doctemplates.changes 2018-05-30 12:25:30.417932757 +0200 @@ -1,0 +2,6 @@ +Mon May 14 17:02:11 UTC 2018 - psim...@suse.com + +- Update doctemplates to version 0.2.2.1. + Upstream does not provide a changelog. + +------------------------------------------------------------------- Old: ---- doctemplates-0.1.0.2.tar.gz New: ---- doctemplates-0.2.2.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-doctemplates.spec ++++++ --- /var/tmp/diff_new_pack.f9iSF9/_old 2018-05-30 12:25:31.257905090 +0200 +++ /var/tmp/diff_new_pack.f9iSF9/_new 2018-05-30 12:25:31.261904958 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-doctemplates # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # 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 doctemplates %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.1.0.2 +Version: 0.2.2.1 Release: 0 Summary: Pandoc-style document templates License: BSD-3-Clause @@ -43,7 +43,7 @@ %endif %description -A simple text templating system predominently used by Pandoc. +A simple text templating system used by pandoc. %package devel Summary: Haskell %{pkg_name} library development files @@ -75,11 +75,10 @@ %ghc_pkg_recache %files -f %{name}.files -%doc LICENSE +%license LICENSE %dir %{_datadir}/%{pkg_name}-%{version} %{_datadir}/%{pkg_name}-%{version}/README.md %files devel -f %{name}-devel.files -%doc doctemplates.cabal %changelog ++++++ doctemplates-0.1.0.2.tar.gz -> doctemplates-0.2.2.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doctemplates-0.1.0.2/README.md new/doctemplates-0.2.2.1/README.md --- old/doctemplates-0.1.0.2/README.md 2016-10-01 16:02:39.000000000 +0200 +++ new/doctemplates-0.2.2.1/README.md 2018-03-09 22:33:04.000000000 +0100 @@ -62,3 +62,5 @@ You may optionally specify separators using `$sep$`, as in the example above. +Anything between the sequence `$--` and the end of the line +will be treated as a comment. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doctemplates-0.1.0.2/doctemplates.cabal new/doctemplates-0.2.2.1/doctemplates.cabal --- old/doctemplates-0.1.0.2/doctemplates.cabal 2016-10-02 12:28:18.000000000 +0200 +++ new/doctemplates-0.2.2.1/doctemplates.cabal 2018-03-16 20:30:46.000000000 +0100 @@ -1,7 +1,7 @@ name: doctemplates -version: 0.1.0.2 +version: 0.2.2.1 synopsis: Pandoc-style document templates -description: Please see README.md +description: A simple text templating system used by pandoc. homepage: https://github.com/jgm/doctemplates#readme license: BSD3 license-file: LICENSE @@ -28,6 +28,8 @@ parsec, unordered-containers, scientific + if !impl(ghc >= 8.0) + build-depends: semigroups == 0.18.* default-language: Haskell2010 ghc-options: -Wall -fno-warn-unused-do-bind diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doctemplates-0.1.0.2/src/Text/DocTemplates.hs new/doctemplates-0.2.2.1/src/Text/DocTemplates.hs --- old/doctemplates-0.1.0.2/src/Text/DocTemplates.hs 2016-10-02 11:35:52.000000000 +0200 +++ new/doctemplates-0.2.2.1/src/Text/DocTemplates.hs 2018-03-16 20:30:18.000000000 +0100 @@ -97,11 +97,12 @@ import Data.ByteString.Lazy (ByteString, fromChunks) import Data.Vector ((!?)) import Data.Scientific (floatingOrInteger) +import Data.Semigroup (Semigroup) -- | A 'Template' is essentially a function that takes -- a JSON 'Value' and produces 'Text'. newtype Template = Template { unTemplate :: Value -> Text } - deriving Monoid + deriving (Semigroup, Monoid) type Variable = [Text] @@ -215,6 +216,7 @@ pFor <|> pNewline <|> pVar <|> + pComment <|> pLit <|> pEscapedDollar) return $ sp <> rest @@ -243,6 +245,16 @@ pEscapedDollar :: Parser Template pEscapedDollar = lit "$" <$ P.try (P.string "$$") +pComment :: Parser Template +pComment = do + pos <- P.getPosition + P.try (P.string "$--") + P.skipMany (P.satisfy (/='\n')) + -- If the comment begins in the first column, the line ending + -- will be consumed; otherwise not. + when (P.sourceColumn pos == 1) $ () <$ P.char '\n' + return mempty + pVar :: Parser Template pVar = var <$> (P.try $ P.char '$' *> pIdent <* P.char '$') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doctemplates-0.1.0.2/test/Spec.hs new/doctemplates-0.2.2.1/test/Spec.hs --- old/doctemplates-0.1.0.2/test/Spec.hs 2016-10-01 22:38:16.000000000 +0200 +++ new/doctemplates-0.2.2.1/test/Spec.hs 2018-03-09 22:33:04.000000000 +0100 @@ -34,6 +34,11 @@ (object ["m" .= (5 :: Integer), "n" .= (7.3 :: Double)]) `shouldBe` (Right "5 and 7.3" :: Either String Text) + it "handles comments" $ do + applyTemplate "hello $--there and $m$\n$-- comment\nbar" + (object ["m" .= (5 :: Integer)]) + `shouldBe` + (Right "hello \nbar" :: Either String Text) it "fails with an incorrect template" $ do applyTemplate "$if(x$and$endif$" (object []) `shouldBe`