Skip to content

Commit

Permalink
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions spec/compiler/formatter/formatter_spec.cr
Original file line number Diff line number Diff line change
@@ -1015,4 +1015,6 @@ describe Crystal::Formatter do
assert_format "def a\n b(\n 1, # x\n # y\n 2\n )\nend"
assert_format "def a\n b(\n a: 1, # x\n # y\n b: 2\n )\nend"
assert_format "def a\n b(\n 1, # x\n # y\n a: 1, # x\n # y\n b: 2 # z\n )\nend"

assert_format "def foo(a, **b : Int32)\nend"
end
6 changes: 2 additions & 4 deletions src/compiler/crystal/tools/formatter.cr
Original file line number Diff line number Diff line change
@@ -1477,10 +1477,8 @@ module Crystal
comma_written = true
end
write_token :"**"
skip_space
check :IDENT
write double_splat
next_token_skip_space
double_splat.accept self
skip_space_or_newline
if block_arg
check :","
write ","

0 comments on commit 2744067

Please sign in to comment.