-
Notifications
You must be signed in to change notification settings - Fork 5
Fix annoying spacing and delimiter issues #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
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3ab7149
add commas between items in single line lists and records
Bahex c193a7c
insert commas between pattern items
Bahex f3342d8
insert spaces around alternate pattern delimiter ('|')
Bahex b3c8fcd
insert space before closing brace in single line match expression
Bahex 51d9a1b
insert delimiters between match arms on a single line
Bahex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,11 +19,15 @@ match $foo { | |
| { name: 'bar' count: $it } if $it < 5 => ($it + 3), # match arm comment | ||
| # match comment | ||
| { name: 'bar' count: $it } if not ($it >= 5) => ($it + 7), | ||
| # record shorthand | ||
| { $name $count } => $'($name): ($count)', | ||
| _ => {exit 0} | ||
| } | ||
| match $foo { | ||
| [ a b c] => 0 | ||
| a|b|c => 42 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe test for a multiline pattern? But I don't even know if that's valid... |
||
| } | ||
| match $foo {null => {return "default"} 1 => "one" 2 => "two" $val => $val} | ||
| # while | ||
| mut x = 0; while $x < 10 { $x = $x + 1 }; $x # while comment | ||
| # loop | ||
|
|
||
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.
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.
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.
I almost forgot, there's a hidden ts issue here:
topiary-nushell/languages/nu.scm
Lines 178 to 179 in b5cd69b
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.
@Bahex Here's a hack to workaround the case in your previous comment, sorry I accidentally deleted it.
And the GitHub webpage is not clever enough to let me commit it. Maybe you'll have to manually do it (same for the val_record) later when we come to a conclusion of the desired behavior.
Uh oh!
There was an error while loading. Please reload this page.
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.
@blindFS you can always suggest a git patch:
tweag/topiary#921 (comment)