htoml-megaparsec 1.1.0.1 → 1.1.0.2
raw patch · 2 files changed
+87/−90 lines, 2 filesdep ~timePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: time
API changes (from Hackage documentation)
Files
- htoml-megaparsec.cabal +87/−80
- src/Text/Toml/Parser.hs +0/−10
htoml-megaparsec.cabal view
@@ -1,88 +1,95 @@-name: htoml-megaparsec-version: 1.1.0.1-synopsis: Parser for TOML files-description: TOML is an obvious and minimal format for config files.- This package provides a TOML parser- built with the Megaparsec.-homepage: https://hub.darcs.net/vmchale/htoml-megaparsec-bug-reports: https://hub.darcs.net/vmchale/htoml-megaparsec/issues-license: BSD3-license-file: LICENSE-copyright: (c) 2013-2016 Cies Breijs, 2017 Vanessa McHale-author: Cies Breijs, Vanessa McHale-maintainer: Vanessa McHale <vamchale@gmail.com>-category: Data, Text, Configuration, Language, TOML-build-type: Simple-cabal-version: >= 1.18-extra-source-files: test/BurntSushi/fetch-toml-tests.sh- , test/BurntSushi/valid/*.toml- , test/BurntSushi/valid/*.json- , test/BurntSushi/invalid/*.toml- , benchmarks/example.toml- , benchmarks/repeated.toml--Extra-doc-files: README.md- , CHANGES.md+cabal-version: 1.18+name: htoml-megaparsec+version: 1.1.0.2+license: BSD3+license-file: LICENSE+copyright: (c) 2013-2016 Cies Breijs, 2017-2018 Vanessa McHale+maintainer: Vanessa McHale <vamchale@gmail.com>+author: Cies Breijs, Vanessa McHale+homepage: https://hub.darcs.net/vmchale/htoml-megaparsec+bug-reports: https://hub.darcs.net/vmchale/htoml-megaparsec/issues+synopsis: Parser for TOML files+description:+ TOML is an obvious and minimal format for config files.+ This package provides a TOML parser+ built with the Megaparsec.+category: Data, Text, Configuration, Language, TOML+build-type: Simple+extra-source-files:+ test/BurntSushi/fetch-toml-tests.sh+ test/BurntSushi/valid/*.toml+ test/BurntSushi/valid/*.json+ test/BurntSushi/invalid/*.toml+ benchmarks/example.toml+ benchmarks/repeated.toml+extra-doc-files: README.md+ CHANGES.md source-repository head- type: darcs- location: https://hub.darcs.net/vmchale/htoml-megaparsec+ type: darcs+ location: https://hub.darcs.net/vmchale/htoml-megaparsec library- exposed-modules: Text.Toml- , Text.Toml.Parser- , Text.Toml.Types- , Text.Megaparsec.CharRW- hs-source-dirs: src- default-language: Haskell2010- build-depends: base >= 4.8 && < 5- , containers >= 0.5- , megaparsec >= 6.0.0- , unordered-containers >= 0.2- , vector >= 0.10- , text >= 1.0 && < 2- , mtl >= 2.2- , composition-prelude >= 0.1.1.0- , deepseq- , time- , old-locale- if impl(ghc >= 8.0)- ghc-options: -Wincomplete-uni-patterns -Wincomplete-record-updates- ghc-options: -Wall+ exposed-modules:+ Text.Toml+ Text.Toml.Parser+ Text.Toml.Types+ Text.Megaparsec.CharRW+ hs-source-dirs: src+ default-language: Haskell2010+ ghc-options: -Wall+ build-depends:+ base >=4.8 && <5,+ containers >=0.5,+ megaparsec >=6.0.0,+ unordered-containers >=0.2,+ vector >=0.10,+ text >=1.0 && <2,+ mtl >=2.2,+ composition-prelude >=0.1.1.0,+ deepseq -any,+ time >=1.5.0,+ old-locale -any+ + if impl(ghc >=8.0)+ ghc-options: -Wincomplete-uni-patterns -Wincomplete-record-updates test-suite htoml-test- hs-source-dirs: test- ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N- main-is: Test.hs- other-modules: BurntSushi- , JSON- , Text.Toml.Parser.Spec- , Text.TomlSpec- type: exitcode-stdio-1.0- default-language: Haskell2010- build-depends: base- , megaparsec- , containers- , hspec- , unordered-containers- , vector- , aeson- , text- , time- , htoml-megaparsec- , bytestring- , file-embed- , tasty- , tasty-hspec- , tasty-hunit+ type: exitcode-stdio-1.0+ main-is: Test.hs+ hs-source-dirs: test+ other-modules:+ BurntSushi+ JSON+ Text.Toml.Parser.Spec+ Text.TomlSpec+ default-language: Haskell2010+ ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N+ build-depends:+ base -any,+ megaparsec -any,+ containers -any,+ hspec -any,+ unordered-containers -any,+ vector -any,+ aeson -any,+ text -any,+ time -any,+ htoml-megaparsec -any,+ bytestring -any,+ file-embed -any,+ tasty -any,+ tasty-hspec -any,+ tasty-hunit -any benchmark benchmarks- hs-source-dirs: benchmarks .- ghc-options: -O2 -Wall- main-is: Benchmarks.hs- type: exitcode-stdio-1.0- default-language: Haskell2010- build-depends: base- , htoml-megaparsec- , criterion- , text+ type: exitcode-stdio-1.0+ main-is: Benchmarks.hs+ hs-source-dirs: benchmarks .+ default-language: Haskell2010+ ghc-options: -Wall+ build-depends:+ base -any,+ htoml-megaparsec -any,+ criterion -any,+ text -any
src/Text/Toml/Parser.hs view
@@ -1,5 +1,4 @@ {-# OPTIONS_GHC -fno-warn-unused-do-bind #-}-{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MonoLocalBinds #-} {-# LANGUAGE OverloadedStrings #-}@@ -21,13 +20,8 @@ import Data.Void import Text.Megaparsec.CharRW -#if MIN_VERSION_time(1,5,0) import Data.Time.Format (defaultTimeLocale, iso8601DateFormat, parseTimeM)-#else-import Data.Time.Format (parseTime)-import System.Locale (defaultTimeLocale, iso8601DateFormat)-#endif import Numeric (readHex) import Text.Megaparsec hiding (runParser)@@ -201,11 +195,7 @@ datetime :: (TomlM m) => Parser m Node datetime = do d <- manyTill anyChar (char 'Z')-#if MIN_VERSION_time(1,5,0) let mt = parseTimeM True defaultTimeLocale (iso8601DateFormat $ Just "%X") d-#else- let mt = parseTime defaultTimeLocale (iso8601DateFormat $ Just "%X") d-#endif case mt of Just t -> return $ VDatetime t Nothing -> throwParser "parsing datetime failed"