json-b 0.0.3 → 0.0.4
raw patch · 4 files changed
+19/−4 lines, 4 files
Files
- Text/JSON/Escape.hs +2/−1
- Text/JSONb/Decode.hs +8/−2
- json-b.cabal +1/−1
- test/SimpleUnits.hs +8/−0
Text/JSON/Escape.hs view
@@ -16,7 +16,8 @@ {-| Class of JSON escapable text. The solidus (@/@) is always escaped, as are- all ASCII control characters. Non-ASCII control characters + all ASCII control characters. Non-ASCII control characters and Unicode+ printable characters above ASCII are left as is. -} class Escape t where escape :: t -> t
Text/JSONb/Decode.hs view
@@ -62,7 +62,10 @@ object = do char '{' whitespace- Object . Trie.fromListS <$> properties []+ Object . Trie.fromListS <$> choice+ [ whitespace >> char '}' >> return []+ , properties []+ ] where properties acc = do key <- string_literal@@ -86,7 +89,10 @@ array :: Parser JSON array = do char '['- Array <$> elements []+ Array <$> choice+ [ whitespace >> char ']' >> return []+ , elements []+ ] where elements acc = do something <- json
json-b.cabal view
@@ -1,5 +1,5 @@ name : json-b-version : 0.0.3+version : 0.0.4 category : Text license : BSD3 license-file : LICENSE
test/SimpleUnits.hs view
@@ -98,6 +98,10 @@ structure_tests = [ ( "[ 7, 6 ]", (JSONb.Array . fmap JSONb.Number) [7, 6] , ["array", "excessive spacing", "integers"] )+ , ( "[]", JSONb.Array []+ , ["array", "compact spacing", "empty"] )+ , ( "[ ]", JSONb.Array []+ , ["array", "normal spacing", "empty"] ) , ( "[7,6]", (JSONb.Array . fmap JSONb.Number) [7, 6] , ["array", "compact spacing", "integers"] ) , ( "[7.6, 21]", (JSONb.Array . fmap JSONb.Number) [7.6, 21.0]@@ -122,6 +126,10 @@ , ( Strict.pack "Build" , JSONb.String (Strict.pack "e605_core_Bundled_8000231_R1") ) ] , ["object", "newlines", "strings"] )+ , ( "{}", JSONb.Object empty+ , ["object", "compact spacing", "empty"] )+ , ( "{ }", JSONb.Object empty+ , ["object", "normal spacing", "empty"] ) , ( "{\"Ack\":\"Success\",\"Build\":\"e605_core_Bundled_8000231_R1\"}" , (JSONb.Object . fromList) [ (Strict.pack "Ack", JSONb.String (Strict.pack "Success"))