packages feed

unicode-data 0.4.0 → 0.4.0.1

raw patch · 5 files changed

+25/−10 lines, 5 filesdep ~basedep ~deepseqdep ~hspec

Dependency ranges changed: base, deepseq, hspec

Files

Changelog.md view
@@ -1,5 +1,9 @@ # Changelog +## 0.4.0.1 (December 2022)++- Fix [Unicode blocks handling on big-endian architectures](https://github.com/composewell/unicode-data/issues/97).+ ## 0.4.0 (September 2022)  - Update to [Unicode 15.0.0](https://www.unicode.org/versions/Unicode15.0.0/).
exe/Parser/Text.hs view
@@ -318,6 +318,8 @@         , "(Block(..), BlockDefinition(..), block, blockDefinition)"         , "where"         , ""+        , "#include \"MachDeps.h\""+        , ""         , "import Data.Ix (Ix)"         , "import GHC.Exts"         , ""@@ -381,9 +383,9 @@         , "    getRawCodePoint# k# ="         , "#ifdef WORDS_BIGENDIAN"         , "#if MIN_VERSION_base(4,16,0)"-        , "        byteSwap32# (word32ToWord# (indexWord32OffAddr# addr# k#))"+        , "        narrow32Word# (byteSwap32# (word32ToWord# (indexWord32OffAddr# ranges# k#)))"         , "#else"-        , "        byteSwap32# (indexWord32OffAddr# ranges# k#)"+        , "        narrow32Word# (byteSwap32# (indexWord32OffAddr# ranges# k#))"         , "#endif"         , "#elif MIN_VERSION_base(4,16,0)"         , "        word32ToWord# (indexWord32OffAddr# ranges# k#)"@@ -1279,9 +1281,9 @@         , "    indexInt32OffAddr'# k# ="         , "#ifdef WORDS_BIGENDIAN"         , "#if MIN_VERSION_base(4,16,0)"-        , "        word2Int# (byteSwap32# (word32ToWord# (indexWord32OffAddr# offsets# k#)))"+        , "        word2Int# (narrow32Word# (byteSwap32# (word32ToWord# (indexWord32OffAddr# offsets# k#))))"         , "#else"-        , "        word2Int# (byteSwap32# (indexWord32OffAddr# offsets# k#))"+        , "        word2Int# (narrow32Word# (byteSwap32# (indexWord32OffAddr# offsets# k#)))"         , "#endif"         , "#elif MIN_VERSION_base(4,16,0)"         , "        int32ToInt# (indexInt32OffAddr# offsets# k#)"
lib/Unicode/Internal/Char/Blocks.hs view
@@ -13,6 +13,8 @@ (Block(..), BlockDefinition(..), block, blockDefinition) where +#include "MachDeps.h"+ import Data.Ix (Ix) import GHC.Exts @@ -729,9 +731,9 @@     getRawCodePoint# k# = #ifdef WORDS_BIGENDIAN #if MIN_VERSION_base(4,16,0)-        byteSwap32# (word32ToWord# (indexWord32OffAddr# addr# k#))+        narrow32Word# (byteSwap32# (word32ToWord# (indexWord32OffAddr# ranges# k#))) #else-        byteSwap32# (indexWord32OffAddr# ranges# k#)+        narrow32Word# (byteSwap32# (indexWord32OffAddr# ranges# k#)) #endif #elif MIN_VERSION_base(4,16,0)         word32ToWord# (indexWord32OffAddr# ranges# k#)
test/Main.hs view
@@ -1,1 +1,10 @@-{-# OPTIONS_GHC -F -pgmF hspec-discover #-}+module Main where++import Test.Hspec+import qualified Unicode.CharSpec++main :: IO ()+main = hspec spec++spec :: Spec+spec = describe "Unicode.Char" Unicode.CharSpec.spec
unicode-data.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.2 name:                unicode-data-version:             0.4.0+version:             0.4.0.1 synopsis:            Access Unicode Character Database (UCD) description:   @unicode-data@ provides Haskell APIs to efficiently access the@@ -148,8 +148,6 @@       base             >= 4.7   && < 4.18     , hspec            >= 2.0   && < 2.11     , unicode-data-  build-tool-depends:-      hspec-discover:hspec-discover >= 2.0 && < 2.11   -- We need to match a GHC version with the same Unicode version.   -- See: test/Unicode/CharSpec.hs for compatibility table.   if impl(ghc >= 9.5.1)