hjson 1.3.1 → 1.3.2
raw patch · 2 files changed
+14/−2 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Text/HJson.hs +13/−1
- hjson.cabal +1/−1
Text/HJson.hs view
@@ -268,7 +268,19 @@ char 'u' digitsV <- count 4 hexDigit let numberV = read ("0x" ++ digitsV)- return $ chr numberV+ if numberV >= 0xD800 && numberV <= 0xDFFF then do+ guard (numberV <= 0xDBFF) <?> "valid UTF-16 char or first half"+ let numberVHigh = numberV - 0xD800+ digitsVLow <- do+ char '\\'+ char 'u'+ count 4 hexDigit+ <?> "continuation of the UTF-16 surrogate pair"+ let numberVLow = read ("0x" ++ digitsVLow) - 0xDC00+ guard (numberVLow >= 0 && numberVLow <= 0x3FF) <?> "valid UTF-16 second half"+ return $ chr (0x10000 + numberVHigh * 2^10 + numberVLow)+ else+ return $ chr numberV numberP :: Monad m => ParsecT String s m Json numberP = do
hjson.cabal view
@@ -1,5 +1,5 @@ Name: hjson-Version: 1.3.1+Version: 1.3.2 Synopsis: JSON parsing library Category: Text Description: JSON parsing library with simple and sane API