Repository navigation
Conversation
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.
Two formatter fixes, both from reading the stdlib.
A final list hugs its call. When a call doesn't fit on one line but everything up to its last argument's
[does, the list breaks and its brackets stay against the parens:This used to be
Object(\n\t[\n …\n\t],\n). It works for tuples too.f([…], [\n…\n])reads lopsided.How it works:
delimited_hug_listmarks the list as a willingHug. The width probe of the hugging call ends its line at the list's first break. A group around the call probes the list at its full width instead:fitsnow tracks whether an entry belongs to the probed group itself. SoOk(Object([…]))breaksOk(the same way it does around a hugged lambda.An operator chain breaks at every operator.
a || b || cis one group per precedence level, and the parser's ownPRECEDENCEtable decides the levels. It stays on one line, or every operand gets its own line, indented under the first:It used to keep the first few operands together and put the rest one per line, with no indent. The operator still ends its line, since a line starting with
-would parse as a new statement.What changes in the repo: I formatted all 103 committed
.scrlfiles with master's formatter and with this one. 10 come out different, and all 10 differences are these two layouts. No file is reformatted in this PR. The stdlib tidy comes next, as its own PR.All seven CI gates pass locally. hawk ran for the host target, and nothing here is gated on a cfg.