From c6416e41b304742435a6cc234dae2471144eb5b1 Mon Sep 17 00:00:00 2001 From: Nitin Prakash Date: Mon, 15 Jul 2024 00:31:43 +0530 Subject: [PATCH] Pretty print readable unicode characters --- src/swarm-lang/Swarm/Language/Pretty.hs | 3 ++- swarm.cabal | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/swarm-lang/Swarm/Language/Pretty.hs b/src/swarm-lang/Swarm/Language/Pretty.hs index 04cfa0cf1..c54663484 100644 --- a/src/swarm-lang/Swarm/Language/Pretty.hs +++ b/src/swarm-lang/Swarm/Language/Pretty.hs @@ -36,6 +36,7 @@ import Swarm.Language.Syntax.Direction import Swarm.Language.Typecheck import Swarm.Language.Types import Swarm.Util (number, showEnum, showLowT, unsnocNE) +import Text.Show.Unicode (ushow) import Witch ------------------------------------------------------------ @@ -271,7 +272,7 @@ instance PrettyPrec (Term' ty) where TDir d -> ppr d TInt n -> pretty n TAntiInt v -> "$int:" <> pretty v - TText s -> fromString (show s) + TText s -> fromString (ushow s) TAntiText v -> "$str:" <> pretty v TBool b -> bool "false" "true" b TRobot r -> " pretty r <> ">" diff --git a/swarm.cabal b/swarm.cabal index aa5c52a9b..3545e3f65 100644 --- a/swarm.cabal +++ b/swarm.cabal @@ -191,6 +191,7 @@ library swarm-lang terminal-size >=0.3 && <1.0, text, text-rope >=0.2 && <0.3, + unicode-show, vector, vty, witch,