Skip to content

Commit

Permalink
Fix extra space in export/public/global/local multiline lists
Browse files Browse the repository at this point in the history
Same issue as in #78, with same fix as in #83, but for a different
edgecase.
  • Loading branch information
fredrikekre committed Nov 19, 2024
1 parent c72cfb4 commit c0654ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/runestone.jl
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ function spaces_in_export_public(ctx::Context, node::Node)
elseif kind(kid) in KSet"Comment NewlineWs"
any_changes && push!(kids′, kid)
accept_node!(ctx, kid)
state = :expect_space
state = kind(kid) === K"Comment" ? (:expect_space) : (:expect_identifier)

Check warning on line 995 in src/runestone.jl

View check run for this annotation

Codecov / codecov/patch

src/runestone.jl#L995

Added line #L995 was not covered by tests
else
unreachable()
end
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,7 @@ end
@test format_string("$(verb) a$(sp),$(sp)#= b, =#$(sp)c") == "$(verb) a, #= b, =# c"
# https://github.com/fredrikekre/Runic.jl/issues/78
@test format_string("$(verb)\n #a\n a,\n\n #b\nb") == "$(verb)\n #a\n a,\n\n #b\n b"
@test format_string("$(verb) $(sp)a,$(sp)\n\n$(sp)b") == "$(verb) a,\n\n b"
end
# Interpolated identifiers (currently only expected in K"quote" and K"macrocall")
@test format_string(":(export \$a)") == ":(export \$a)"
Expand Down

0 comments on commit c0654ea

Please sign in to comment.