Skip to content

Commit

Permalink
parse with latest 1.x compatible syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Jul 23, 2024
1 parent 025ad41 commit 47905c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Runic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function Context(
)
src_io = IOBuffer(src_str)
src_tree = Node(
JuliaSyntax.parseall(JuliaSyntax.GreenNode, src_str; ignore_warnings = true),
JuliaSyntax.parseall(JuliaSyntax.GreenNode, src_str; ignore_warnings = true, version = v"2-"),
)
fmt_io = IOBuffer()
fmt_tree = nothing
Expand Down
7 changes: 7 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -782,3 +782,10 @@ end
@test format_string("f(a,\tb)") == "f(a, b)"
@test format_string("begin\n\tx = 1\nend") == "begin\n x = 1\nend"
end

@testset "parsing new syntax" begin
# Check that it parses
@test format_string("public a,b") == "public a,b"
# But currently not actually getting formatted:
@test_broken format_string("public a,b") == "public a, b"
end

0 comments on commit 47905c5

Please sign in to comment.