Skip to content

Commit

Permalink
show unicode characters without escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira committed May 24, 2023
1 parent 4fcb881 commit 35ea0df
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ dependencies:
- th-utilities == 0.2.*
- time == 1.11.*
- transformers == 0.5.*
- unicode-show == 0.1.*
- uniplate == 1.6.*
- unix-compat == 0.5.*
- unordered-containers == 0.2.*
Expand Down
2 changes: 1 addition & 1 deletion src/Juvix/Data/CodeAnn.hs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ endSemicolon :: Doc Ann -> Doc Ann
endSemicolon x = x <> kwSemicolon

ppStringLit :: Text -> Doc Ann
ppStringLit = annotate AnnLiteralString . pretty @Text . show
ppStringLit = annotate AnnLiteralString . pretty . pack . urecover . show

bracesIndent :: Doc Ann -> Doc Ann
bracesIndent = braces . blockIndent
Expand Down
2 changes: 2 additions & 0 deletions src/Juvix/Prelude/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module Juvix.Prelude.Base
( module Juvix.Prelude.Base,
module Control.Applicative,
module Data.Graph,
module Text.Show.Unicode,
module Data.Map.Strict,
module Data.Set,
module Data.IntMap.Strict,
Expand Down Expand Up @@ -188,6 +189,7 @@ import System.IO.Error
import Text.Read qualified as Text
import Text.Show (Show)
import Text.Show qualified as Show
import Text.Show.Unicode (ushow, urecover)
import Prelude (Double)

--------------------------------------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions tests/positive/Format.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ end;

import Stdlib.Prelude open using {Nat as Natural};

module UnicodeStrings;
a : String;
a := "λ";
end;

module Comments;
axiom a1 : Type;
-- attached to a1
Expand Down

0 comments on commit 35ea0df

Please sign in to comment.