Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show unicode characters without escaping #2127

Merged
merged 2 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 (urecover, ushow)
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