Skip to content

Commit

Permalink
Fix formatting semicolon after block paren (#6192)
Browse files Browse the repository at this point in the history
Fixed #6164
  • Loading branch information
makenowjust authored and bcardiff committed Jun 13, 2018
1 parent ebef46b commit 20d3549
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/compiler/formatter/formatter_spec.cr
Expand Up @@ -267,6 +267,8 @@ describe Crystal::Formatter do
assert_format "foo(\n 1,\n a: 1,\n b: 2,\n)"
assert_format "foo(1, ) { }", "foo(1) { }"
assert_format "foo(1, ) do\nend", "foo(1) do\nend"
assert_format "foo {;1}", "foo { 1 }"
assert_format "foo {;;1}", "foo { 1 }"

assert_format "foo.bar\n.baz", "foo.bar\n .baz"
assert_format "foo.bar.baz\n.qux", "foo.bar.baz\n .qux"
Expand Down
1 change: 1 addition & 0 deletions src/compiler/crystal/tools/formatter.cr
Expand Up @@ -2631,6 +2631,7 @@ module Crystal
write " {"
next_token_skip_space
body = format_block_args node.args, node
next_token_skip_space_or_newline if @token.type == :";"
if @token.type == :NEWLINE
format_nested body
skip_space_or_newline
Expand Down

0 comments on commit 20d3549

Please sign in to comment.