Skip to content

Commit

Permalink
Remove extra newline in top-level FunDef's string representation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
HertzDevil authored Jan 12, 2024
1 parent f5844b0 commit 3bf68dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion spec/compiler/parser/to_s_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ describe "ASTNode#to_s" do
expect_to_s %(@[Foo(1, 2, a: 1, b: 2)])
expect_to_s %(lib Foo\nend)
expect_to_s %(lib LibC\n fun getchar(Int, Float)\nend)
expect_to_s %(fun foo(a : Void, b : Void, ...) : Void\n\nend)
expect_to_s %(fun foo(a : Void, b : Void, ...) : Void\nend)
expect_to_s %(fun foo\nend)
expect_to_s %(lib Foo\n struct Foo\n a : Void\n b : Void\n end\nend)
expect_to_s %(lib Foo\n union Foo\n a : Int\n b : Int32\n end\nend)
expect_to_s %(lib Foo\n FOO = 0\nend)
Expand Down
1 change: 0 additions & 1 deletion src/compiler/crystal/syntax/to_s.cr
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,6 @@ module Crystal
if body = node.body
newline
accept_with_indent body
newline
append_indent
@str << "end"
end
Expand Down

0 comments on commit 3bf68dd

Please sign in to comment.