Browse Source

Fix non-K"Identifier" leafs in export lists

pull/26/head
Fredrik Ekre 1 year ago
parent
commit
9043278d44
No known key found for this signature in database
GPG Key ID: DE82E6D5E364C0A2
  1. 2
      src/runestone.jl
  2. 2
      test/runtests.jl

2
src/runestone.jl

@ -974,7 +974,7 @@ function spaces_in_export_public(ctx::Context, node::Node) @@ -974,7 +974,7 @@ function spaces_in_export_public(ctx::Context, node::Node)
state = :expect_identifier
elseif state === :expect_identifier
state = :expect_comma
if kind(kid) in KSet"Identifier @ MacroName $"
if kind(kid) in KSet"Identifier @ MacroName $" || JuliaSyntax.is_operator(kid)
any_changes && push!(kids′, kid)
accept_node!(ctx, kid)
if kind(kid) === K"@"

2
test/runtests.jl

@ -840,6 +840,8 @@ end @@ -840,6 +840,8 @@ end
@test format_string(":(export \$a)") == ":(export \$a)"
@test format_string("quote\nexport \$a, \$b\nend") == "quote\n export \$a, \$b\nend"
@test_throws Exception format_string("export \$a")
# Non-identifiers
@test format_string("export ^") == "export ^"
end
@testset "parsing new syntax" begin

Loading…
Cancel
Save