From d726c19d280c36fa4e5f976588129102dd8558cc Mon Sep 17 00:00:00 2001 From: normalcoder <normalcoder@gmail.com> Date: Sat, 4 Nov 2023 22:28:30 +0100 Subject: [PATCH] fix MultilineStrings --- compiler/GHC/Driver/MultilineStrings.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/GHC/Driver/MultilineStrings.hs b/compiler/GHC/Driver/MultilineStrings.hs index fb0e00499d4b..d9a637814059 100644 --- a/compiler/GHC/Driver/MultilineStrings.hs +++ b/compiler/GHC/Driver/MultilineStrings.hs @@ -11,7 +11,7 @@ convertMultilineStrings s = go s WaitingForString 0 '-':'-':s -> '-':'-': skipOneLineComment s '{':'-':s -> '{':'-': skipComment s '"':'"':'"':'\n':'"':'"':'"':s -> '"':'"': go s state 3 - '"':'"':'"':'\n':s -> '\n':' ':'"' : go s InString charCnt + '"':'"':'"':'\n':s -> "\n" ++ replicate charCnt ' ' ++ "\"" ++ go s InString charCnt '\n':s -> '\n' : go s state 0 c:s -> c : go s state (charCnt + 1) InString -> case s of @@ -19,7 +19,7 @@ convertMultilineStrings s = go s WaitingForString 0 '\n':'"':'"':'"':s -> '"':'\n' : go s WaitingForString 0 '"':s -> '\\':'"' : go s state charCnt '\\':s -> '\\':'\\' : go s state charCnt - '\n':s -> "\\n\"\n" ++ replicate charCnt ' ' ++ " ++ \"" ++ go s state charCnt + '\n':s -> "\\n\"\n" ++ replicate charCnt ' ' ++ "++ \"" ++ go s state charCnt c:s -> c : go s state charCnt where skipOneLineComment "" = go "" state charCnt -- GitLab