Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix escaping significant leading whitespace for multiline strings #1598

Merged
merged 3 commits into from
Dec 8, 2019

Conversation

Gabriella439
Copy link
Collaborator

Fixes #1590

This reuses the same logic for computing the longest shared whitespace prefix
that the parser uses in order to ensure consistency of behavior between the
two. Once we compute the longest shared whitespace prefix we escape all
lines with that prefix. Only one such escape is technically necessary, but
escaping all of them improves horizontal alignment of the result

Fixes #1590

This reuses the same logic for computing the longest shared whitespace prefix
that the parser uses in order to ensure consistency of behavior between the
two.  Once we compute the longest shared whitespace prefix we escape *all*
lines with that prefix.  Only one such escape is technically necessary, but
escaping all of them improves horizontal alignment of the result
Copy link
Collaborator

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That alignment is a nice idea! 👍

dhall/src/Dhall/Syntax.hs Outdated Show resolved Hide resolved
... as suggested by @sjakobi

Co-Authored-By: Simon Jakobi <simon.jakobi@gmail.com>
@mergify mergify bot merged commit 30d9345 into master Dec 8, 2019
@mergify mergify bot deleted the gabriel/1590 branch December 8, 2019 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dhall format on linux behaves differently than on osx/darwin (dhall 1.28.0)
2 participants