Skip to content

Commit

Permalink
revert: revert part of the previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
aboeglin committed Apr 20, 2024
1 parent fc685d8 commit 4befcd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/main/Canonicalize/Canonicalize.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions compiler/main/Format/Format.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down

0 comments on commit 4befcd8

Please sign in to comment.