diff --git a/src/Juvix/Data/CodeAnn.hs b/src/Juvix/Data/CodeAnn.hs index d60698ffa2..e8312484bc 100644 --- a/src/Juvix/Data/CodeAnn.hs +++ b/src/Juvix/Data/CodeAnn.hs @@ -238,12 +238,7 @@ endSemicolon :: Doc Ann -> Doc Ann endSemicolon x = x <> kwSemicolon ppStringLit :: Text -> Doc Ann -ppStringLit = annotate AnnLiteralString . doubleQuotes . escaped - where - showChar :: Char -> String - showChar c = showLitChar c ("" :: String) - escaped :: Text -> Doc a - escaped = mconcatMap (pretty . showChar) . unpack +ppStringLit = annotate AnnLiteralString . pretty @Text . show bracesIndent :: Doc Ann -> Doc Ann bracesIndent = braces . blockIndent diff --git a/tests/positive/Format.juvix b/tests/positive/Format.juvix index 283e39a27a..8edab53daa 100644 --- a/tests/positive/Format.juvix +++ b/tests/positive/Format.juvix @@ -46,6 +46,10 @@ t3 := , "k" , "1234"; +-- escaping in String literals +e1 : String; +e1 := "\"\n"; + infixl 7 +l7; axiom +l7 : String → String → String;