diff --git a/src/Language/JSON/Translate.hs b/src/Language/JSON/Translate.hs index d4bb8fc60..f08a3fbd1 100644 --- a/src/Language/JSON/Translate.hs +++ b/src/Language/JSON/Translate.hs @@ -15,10 +15,17 @@ data JSONBeautyOpts = JSONBeautyOpts { jsonPrettyPrint :: Bool } defaultBeautyOpts :: JSONBeautyOpts defaultBeautyOpts = JSONBeautyOpts True + +defaultJSONPipeline :: ProcessT (Eff effs) Splice Splice +defaultJSONPipeline + = translatingJSON + ~> beautifyingJSON defaultBeautyOpts + + translatingJSON :: ProcessT (Eff effs) Splice Splice translatingJSON = flattened <~ auto step where step :: Splice -> Seq Splice - step (Insert el@(Truth True) c _) = splice el c "True" + step (Insert el@(Truth True) c _) = splice el c "true" step x = pure x beautifyingJSON :: JSONBeautyOpts -> ProcessT (Eff effs) Splice Splice diff --git a/src/Reprinting/Translate.hs b/src/Reprinting/Translate.hs index 5527bb9fb..24c4c682d 100644 --- a/src/Reprinting/Translate.hs +++ b/src/Reprinting/Translate.hs @@ -52,9 +52,9 @@ translating = flattened <~ autoT (Kleisli step) where translate el c = let emit = pure . splice el c in case (el, c) of (Fragment f, _) -> emit f - (Truth True, _) -> emit "true" - (Truth False, _) -> emit "false" - (Nullity, _) -> emit "null" + (Truth True, _) -> emit "True" + (Truth False, _) -> emit "False" + (Nullity, _) -> emit "Null" (Open, Just List) -> emit "[" (Open, Just Associative) -> emit "{" diff --git a/src/Semantic/Util.hs b/src/Semantic/Util.hs index c34a1ceaf..7716f5eef 100644 --- a/src/Semantic/Util.hs +++ b/src/Semantic/Util.hs @@ -349,6 +349,6 @@ testJSONFile = do testPipeline = do (src, tree) <- testJSONFile - printToTerm $ runReprinter src (translatingJSON ~> beautifyingJSON defaultBeautyOpts) (mark Refactored tree) + printToTerm $ runReprinter src defaultJSONPipeline (mark Refactored tree) printToTerm res = either (putStrLn . show) (BC.putStr . Source.sourceBytes) res