Browse Source

parse with latest 1.x compatible syntax (#24)

pull/26/head
Kristoffer Carlsson 1 year ago committed by GitHub
parent
commit
ebc2ba5917
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      src/Runic.jl
  2. 7
      test/runtests.jl

2
src/Runic.jl

@ -144,7 +144,7 @@ function Context(
) )
src_io = IOBuffer(src_str) src_io = IOBuffer(src_str)
src_tree = Node( 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_io = IOBuffer()
fmt_tree = nothing fmt_tree = nothing

7
test/runtests.jl

@ -782,3 +782,10 @@ end
@test format_string("f(a,\tb)") == "f(a, b)" @test format_string("f(a,\tb)") == "f(a, b)"
@test format_string("begin\n\tx = 1\nend") == "begin\n x = 1\nend" @test format_string("begin\n\tx = 1\nend") == "begin\n x = 1\nend"
end 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

Loading…
Cancel
Save