mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-11 10:35:57 +03:00
Text literals can display non-ascii chars
This commit is contained in:
parent
4b20ca7768
commit
34b647fb7c
@ -14,6 +14,7 @@ import qualified Data.Map as Map
|
||||
import qualified Data.Set as Set
|
||||
import Data.Text ( splitOn, unpack )
|
||||
import qualified Data.Text as Text
|
||||
import qualified Text.Show.Unicode as U
|
||||
import Data.Vector ( )
|
||||
import Unison.ABT ( pattern AbsN', reannotateUp, annotation )
|
||||
import qualified Unison.ABT as ABT
|
||||
@ -187,7 +188,7 @@ pretty0
|
||||
-- metaprograms), then it needs to be able to print them (and then the
|
||||
-- parser ought to be able to parse them, to maintain symmetry.)
|
||||
Boolean' b -> fmt S.BooleanLiteral $ if b then l "true" else l "false"
|
||||
Text' s -> fmt S.TextLiteral $ l $ show s
|
||||
Text' s -> fmt S.TextLiteral $ l $ U.ushow s
|
||||
Char' c -> fmt S.CharLiteral $ l $ case showEscapeChar c of
|
||||
Just c -> "?\\" ++ [c]
|
||||
Nothing -> '?': [c]
|
||||
|
@ -201,7 +201,8 @@ library
|
||||
unison-core,
|
||||
unliftio,
|
||||
util,
|
||||
vector
|
||||
vector,
|
||||
unicode-show
|
||||
|
||||
ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
|
||||
default-extensions:
|
||||
|
5
unison-src/transcripts/escape-sequences.md
Normal file
5
unison-src/transcripts/escape-sequences.md
Normal file
@ -0,0 +1,5 @@
|
||||
```unison
|
||||
> "Rúnar"
|
||||
> "῎Ανδρα μοι ἔννεπε, Μοῦσα, πολύτροπον"
|
||||
> "古池や蛙飛びこむ水の音"
|
||||
```
|
28
unison-src/transcripts/escape-sequences.output.md
Normal file
28
unison-src/transcripts/escape-sequences.output.md
Normal file
@ -0,0 +1,28 @@
|
||||
```unison
|
||||
> "Rúnar"
|
||||
> "῎Ανδρα μοι ἔννεπε, Μοῦσα, πολύτροπον"
|
||||
> "古池や蛙飛びこむ水の音"
|
||||
```
|
||||
|
||||
```ucm
|
||||
|
||||
✅
|
||||
|
||||
scratch.u changed.
|
||||
|
||||
Now evaluating any watch expressions (lines starting with
|
||||
`>`)... Ctrl+C cancels.
|
||||
|
||||
1 | > "Rúnar"
|
||||
⧩
|
||||
"Rúnar"
|
||||
|
||||
2 | > "῎Ανδρα μοι ἔννεπε, Μοῦσα, πολύτροπον"
|
||||
⧩
|
||||
"῎Ανδρα μοι ἔννεπε, Μοῦσα, πολύτροπον"
|
||||
|
||||
3 | > "古池や蛙飛びこむ水の音"
|
||||
⧩
|
||||
"古池や蛙飛びこむ水の音"
|
||||
|
||||
```
|
Loading…
Reference in New Issue
Block a user