dhall-haskell/dhall/tests/format/stringWithNullB.dhall
Simon Jakobi 1a831d1813
Preserve leading whitespace in multi-line strings (#1550)
… by moving any leading whitespace on the _last_ line into a string interpolation.

This ensures that the parser can find the correct indentation level, no matter
what the other lines contain.

The additional null-check in prettyChunks is necessary to preserve formatting
idempotence. Otherwise

    "\n "

is first formatted as

    ''

    ${" "}''

but turns into

    "\n${" "}"

on re-formatting.

Fixes #1545.
2019-11-17 18:45:51 +01:00

4 lines
32 B
Plaintext

''
${"\u0000"} $ \
${" "}☺''