Replace tabs in JSON source so the error messages look okay
commit0cc5c94ca6ed13f60fac0490e93d376abdf7f7ee
authorEvan Czaplicki <evancz@users.noreply.github.com>
dateTue 20 Feb 2018, 19:46 (9 years ago)
parent772478f
src/Json/Decode.hs+4−1
@@ -46,8 +46,11 @@ import qualified Reporting.Render.Code as Code
4646parse :: FilePath -> String -> (e -> [H.Doc]) -> Json.Decoder e a -> B.ByteString -> Either H.Doc a
4747parse path rootName userErrorToDocs (Json.Decoder run) bytestring =
4848 let
49+ source =
50+ Code.toSource (Text.replace "\t" " " (Text.decodeUtf8 bytestring))
51+
4952 toDoc err =
50− J.toDoc path rootName (Code.toSource (Text.decodeUtf8 bytestring)) userErrorToDocs err
53+ J.toDoc path rootName source userErrorToDocs err
5154 in
5255 case P.run jsonFile bytestring of
5356 Left err ->