| a | b | |
|---|
| 0 | + | -- test.hs |
|---|
| 0 | + | module Main where |
|---|
| 0 | + | |
|---|
| 0 | + | import Text.JSON |
|---|
| 0 | + | |
|---|
| 0 | + | main = do |
|---|
| 0 | + | x <- getLine |
|---|
| 0 | + | putStrLn (show $ (decode x :: Result JSValue)) |
|---|
| 0 | + | main |
|---|
| 0 | + | |
|---|
| 0 | + | -- problem |
|---|
| 0 | + | ["this","is","some","json",{"that":"works"}] |
|---|
| 0 | + | ["this","does |
|---|
| 0 | + | not"] |
|---|
| 0 | + | |
|---|
| 0 | + | -- nonexhaustive_pattern.patch |
|---|
| 0 | + | --- Text/JSON/String.hs 2010-03-07 10:16:59.410835389 +0100 |
|---|
| 0 | + | +++ Text/JSON/String.hs_ 2010-03-07 10:04:39.627628526 +0100 |
|---|
| 0 | + | @@ -128,6 +128,7 @@ |
|---|
| 0 | + | '\\' : c : ds -> esc rs c ds |
|---|
| 0 | + | '"' : ds -> do setInput ds |
|---|
| 0 | + | return (JSString (toJSString (reverse rs))) |
|---|
| 0 | + | + [] -> fail $ "Unexpected end of String: " ++ reverse (context rs) |
|---|
| 0 | + | c : ds |
|---|
| 0 | + | | c >= '\x20' && c <= '\xff' -> parse (c:rs) ds |
|---|
| 0 | + | | c < '\x20' -> fail $ "Illegal unescaped character in string: " ++ context cs |
|---|
| ... | |
|---|