diff --git a/compiler/main/Canonicalize/Canonicalize.hs b/compiler/main/Canonicalize/Canonicalize.hs index c23cc9e9..bb2ed302 100644 --- a/compiler/main/Canonicalize/Canonicalize.hs +++ b/compiler/main/Canonicalize/Canonicalize.hs @@ -140,6 +140,9 @@ instance Canonicalizable Src.Exp Can.Exp where Src.Source _ _ (Src.LStr "") -> Nothing + Src.Source area srcTarget (Src.LStr s) -> + Just $ Src.Source area srcTarget (Src.LStr ("\"" <> s <> "\"")) + _ -> Just exp diff --git a/compiler/main/Format/Format.hs b/compiler/main/Format/Format.hs index c5d39173..bcc2b68c 100644 --- a/compiler/main/Format/Format.hs +++ b/compiler/main/Format/Format.hs @@ -1156,6 +1156,8 @@ expToDoc comments exp = Source _ _ (LStr s) -> if "\n" `isSuffixOf` s then (Pretty.pretty (init s) <> Pretty.hardline, comments') + else if "\n" `isPrefixOf` s then + (Pretty.hardline <> Pretty.pretty (tail s), comments') else (Pretty.pretty s, comments')