Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions spec/compiler/formatter/formatter_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2893,6 +2893,14 @@ describe Crystal::Formatter do
end
end

# #14256
assert_format <<-CRYSTAL
foo bar # comment

# doc
def baz; end
CRYSTAL

# CVE-2021-42574
describe "Unicode bi-directional control characters" do
['\u202A', '\u202B', '\u202C', '\u202D', '\u202E', '\u2066', '\u2067', '\u2068', '\u2069'].each do |char|
Expand Down
2 changes: 0 additions & 2 deletions src/compiler/crystal/tools/formatter.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2981,8 +2981,6 @@ module Crystal
end

def finish_args(has_parentheses, has_newlines, ends_with_newline, found_comment, column)
skip_space

if has_parentheses
if @token.type.op_comma?
next_token
Expand Down