Merged
Conversation
Rather than stripping all whitespace after parsing, then adding it back between every expression, we now mostly keep whatever whitespace existed in the input. This partially reverts 20d8a2d. With the other changes in that commit, we had assumed that this sledgehammer approach to whitespace was virtually necessary. This commit shows that, with a bit more care, that needn't be the case. We add some tests for inputs on which we had regressed to unpleasantly whitespace-heavy output.
With the whitespace handling changes in the previous commit, it became far simpler, and ultimately unnecessary. We inline the one non-trivial part in to `prettyExpr`.
georgefst
commented
Mar 28, 2022
Closed
cdepillabout
approved these changes
Mar 29, 2022
Owner
cdepillabout
left a comment
There was a problem hiding this comment.
Great, thanks for working on this!
This looks good to me.
You want to add a CHANGELOG and make a release?
Comment on lines
+691
to
+712
| -- __Weird/illegal show instances__ | ||
| -- | ||
| -- >>> pPrintString "2019-02-18 20:56:24.265489 UTC" | ||
| -- 2019-02-18 20:56:24.265489 UTC | ||
| -- | ||
| -- >>> pPrintString "a7ed86f7-7f2c-4be5-a760-46a3950c2abf" | ||
| -- a7ed86f7-7f2c-4be5-a760-46a3950c2abf | ||
| -- | ||
| -- >>> pPrintString "192.168.0.1:8000" | ||
| -- 192.168.0.1:8000 | ||
| -- | ||
| -- >>> pPrintString "A @\"type\" 1" | ||
| -- A @"type" 1 | ||
| -- | ||
| -- >>> pPrintString "2+2" | ||
| -- 2+2 | ||
| -- | ||
| -- >>> pPrintString "1.0e-2" | ||
| -- 1.0e-2 | ||
| -- | ||
| -- >>> pPrintString "0x1b" | ||
| -- 0x1b |
Collaborator
Author
I'm inclined to wait a few days, to see if anyone has any concerns (#75 (comment)). If there's no response, I'll release on the weekend. |
Owner
|
That sounds good to me! |
Collaborator
Author
|
Actually, I'll do it now. I don't know if I'll have time on the weekend. |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #75.
to do