Improve formatting of multi-line literals (#1569)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/1566 This changes multi-line literals so that they can be formatted independently of their surrounding expression
This commit is contained in:
parent
d7cd30d2ce
commit
ff4e1d7028
|
@ -1092,7 +1092,7 @@ prettyCharacterSet characterSet expression =
|
||||||
| anyText (== '\n') =
|
| anyText (== '\n') =
|
||||||
if not (null a) || anyText (/= '\n')
|
if not (null a) || anyText (/= '\n')
|
||||||
then long
|
then long
|
||||||
else Pretty.flatAlt long short
|
else Pretty.group (Pretty.flatAlt long short)
|
||||||
| otherwise =
|
| otherwise =
|
||||||
short
|
short
|
||||||
where
|
where
|
||||||
|
|
1
dhall/tests/format/multilineArgumentA.dhall
Normal file
1
dhall/tests/format/multilineArgumentA.dhall
Normal file
|
@ -0,0 +1 @@
|
||||||
|
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff xxxxxxxxxxxxxxxx "\n"
|
3
dhall/tests/format/multilineArgumentB.dhall
Normal file
3
dhall/tests/format/multilineArgumentB.dhall
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||||
|
xxxxxxxxxxxxxxxx
|
||||||
|
"\n"
|
Loading…
Reference in New Issue
Block a user