on master help sign in
Replace tabs in JSON source so the error messages look okay
0cc5c94Evan Czaplicki
src/Json/Decode.hs+4−1
@@ -46,8 +46,11 @@ import qualified Reporting.Render.Code as Code
46parse :: FilePath -> String -> (e -> [H.Doc]) -> Json.Decoder e a -> B.ByteString -> Either H.Doc a
46parse :: FilePath -> String -> (e -> [H.Doc]) -> Json.Decoder e a -> B.ByteString -> Either H.Doc a
47parse path rootName userErrorToDocs (Json.Decoder run) bytestring =
47parse path rootName userErrorToDocs (Json.Decoder run) bytestring =
48 let
48 let
49+ source =
50+ Code.toSource (Text.replace "\t" " " (Text.decodeUtf8 bytestring))
51+
49 toDoc err =
52 toDoc err =
50− J.toDoc path rootName (Code.toSource (Text.decodeUtf8 bytestring)) userErrorToDocs err
53+ J.toDoc path rootName source userErrorToDocs err
51 in
54 in
52 case P.run jsonFile bytestring of
55 case P.run jsonFile bytestring of
53 Left err ->
56 Left err ->