@@ -83,7 +83,7 @@ import Control.Monad.ST (ST, runST)
83
83
import Control.Monad.ST.Run (runSmallArrayST )
84
84
import Control.Monad.Trans.Class (lift )
85
85
import Control.Monad.Trans.Except (except , runExceptT )
86
- import Data.Bits (unsafeShiftR , (.&.) , (.|.) , xor )
86
+ import Data.Bits (unsafeShiftR , (.&.) , (.|.) )
87
87
import Data.Builder.ST (Builder )
88
88
import Data.Bytes.Chunks (Chunks )
89
89
import Data.Bytes.Parser (Parser )
@@ -94,12 +94,12 @@ import Data.Number.Scientific (Scientific)
94
94
import Data.Primitive (Array , ByteArray (ByteArray ), MutableByteArray , Prim , PrimArray , SmallArray )
95
95
import Data.Text.Internal (Text (Text ))
96
96
import Data.Text.Short (ShortText )
97
- import GHC.Exts (Char (C #), Int (I #), chr #, gtWord #, ltWord #, word2Int #, minusWord #)
98
- import GHC.Exts (Int #, ByteArray #, word8ToWord #, word16ToWord # )
97
+ import GHC.Exts (Char (C #), Int (I #), ltWord #, minusWord #)
98
+ import GHC.Exts (Int #, ByteArray #, word8ToWord #)
99
99
import GHC.Exts (RuntimeRep (IntRep ,TupleRep ,BoxedRep ), Levity (Unlifted ))
100
100
import GHC.Exts (and #, xor #)
101
101
import GHC.Int (Int16 , Int32 , Int64 , Int8 )
102
- import GHC.Word (Word16 ( W16 #) , Word32 , Word64 , Word8 (W8 #), Word (W #))
102
+ import GHC.Word (Word16 , Word32 , Word64 , Word8 (W8 #), Word (W #))
103
103
104
104
import qualified Data.Builder.ST as B
105
105
import qualified Data.ByteString.Short.Internal as BSS
@@ -115,11 +115,9 @@ import qualified Data.List as List
115
115
import qualified Data.Number.Scientific as SCI
116
116
import qualified Data.Primitive as PM
117
117
import qualified Data.Primitive.Contiguous as Contiguous
118
- import qualified Data.Text
119
118
import qualified Data.Text.Short as TS
120
119
import qualified Data.Text.Short.Unsafe as TS
121
120
import qualified Prelude
122
- import qualified Data.Bytes.Parser.Rebindable as RB
123
121
124
122
{- | The JSON syntax tree described by the ABNF in RFC 7159. Notable
125
123
design decisions include:
@@ -552,9 +550,10 @@ copyAndEscape# !maxLen =
552
550
0x22 ->
553
551
(P. effect (PM. unsafeFreezeByteArray =<< PM. resizeMutableByteArray dst ix))
554
552
`P.bindFromLiftedToByteArrayIntInt` \ str ->
555
- P. pureByteArrayIntInt $ case byteArrayToShortByteString str of
556
- BSS. SBS str' -> -- error ("Escaped string: " ++ Data.Text.unpack (Text (ByteArray str') 0 (I# ix#)))
557
- (# str', 0 # , ix# # )
553
+ P. pureByteArrayIntInt
554
+ ( case byteArrayToShortByteString str of
555
+ BSS. SBS str' -> (# str', 0 # , ix# # )
556
+ )
558
557
_ | theCharW >= 0x20 , theCharW < 127 ->
559
558
(P. effect (PM. writeByteArray dst ix theCharW))
560
559
`P.bindFromLiftedToByteArrayIntInt` \ _ ->
0 commit comments