-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Fewer spaces #105
Fewer spaces #105
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`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for working on this!
This looks good to me.
You want to add a CHANGELOG and make a release?
-- __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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the examples!
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. |
That sounds good to me! |
Actually, I'll do it now. I don't know if I'll have time on the weekend. |
Closes #75.
to do