diff --git a/.github/workflows/Check.yml b/.github/workflows/Check.yml index 12f6fc4..cf8f2f9 100644 --- a/.github/workflows/Check.yml +++ b/.github/workflows/Check.yml @@ -17,10 +17,7 @@ jobs: fail-fast: false matrix: version: - - '1.6' - - '1.7' - - '1.8' - - '1.9' + - '1.10' - '1' - 'nightly' env: diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 9b4f67f..80a63fb 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -17,10 +17,7 @@ jobs: fail-fast: false matrix: version: - - '1.6' - - '1.7' - - '1.8' - - '1.9' + - '1.10' - '1' - 'nightly' os: diff --git a/Project.toml b/Project.toml index 31e166c..a55e6c9 100644 --- a/Project.toml +++ b/Project.toml @@ -9,6 +9,7 @@ Preferences = "21216c6a-2e73-6563-6e65-726566657250" [compat] JuliaSyntax = "0.4.10" Preferences = "1" +julia = "1.10" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/src/Runic.jl b/src/Runic.jl index da9ea2e..0fdd152 100644 --- a/src/Runic.jl +++ b/src/Runic.jl @@ -5,15 +5,6 @@ module Runic using JuliaSyntax: JuliaSyntax, @K_str, @KSet_str -# Julia compat for const struct fields -@eval macro $(Symbol("const"))(field) - if VERSION >= v"1.8.0-DEV.1148" - Expr(:const, esc(field)) - else - return esc(field) - end -end - # Debug and assert utilities include("debug.jl") include("JuliaSyntax.jl") @@ -121,11 +112,11 @@ end mutable struct Context # Input - @const src_str::String - @const src_tree::Node - @const src_io::IOBuffer + const src_str::String + const src_tree::Node + const src_io::IOBuffer # Output - @const fmt_io::IOBuffer + const fmt_io::IOBuffer fmt_tree::Union{Node, Nothing} # User settings quiet::Bool diff --git a/src/debug.jl b/src/debug.jl index 37130ae..35e368d 100644 --- a/src/debug.jl +++ b/src/debug.jl @@ -4,11 +4,6 @@ # Debug info # ############## -# @lock is defined but not exported in older Julia versions -if VERSION < v"1.7.0" - using Base: @lock -end - # Code derived from ToggleableAsserts.jl kept in a separate file include("ToggleableAsserts.jl") diff --git a/src/main.jl b/src/main.jl index f68c314..a6263b5 100644 --- a/src/main.jl +++ b/src/main.jl @@ -1,10 +1,7 @@ # SPDX-License-Identifier: MIT -@static if VERSION >= v"1.8" - errno::Cint = 0 -else - errno = 0 -end +# Return code of main +errno::Cint = 0 # Check whether we are compiling with juliac using Preferences: @load_preference diff --git a/test/runtests.jl b/test/runtests.jl index bbe604f..52ba8d3 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -627,24 +627,22 @@ end @test format_string( "try\n$(sp)x\n$(sp)finally\n$(sp)y\n$(sp)catch err\n$(sp)z\n$(sp)end" ) == "try\n x\nfinally\n y\ncatch err\n z\nend" - if VERSION >= v"1.8" - # try-catch-else-end - @test format_string( - "try\n$(sp)x\n$(sp)catch\n$(sp)y\n$(sp)else\n$(sp)z\n$(sp)end" - ) == "try\n x\ncatch\n y\nelse\n z\nend" - # try-catch(err)-else-end - @test format_string( - "try\n$(sp)x\n$(sp)catch err\n$(sp)y\n$(sp)else\n$(sp)z\n$(sp)end" - ) == "try\n x\ncatch err\n y\nelse\n z\nend" - # try-catch-else-finally-end - @test format_string( - "try\n$(sp)x\n$(sp)catch\n$(sp)y\n$(sp)else\n$(sp)z\n$(sp)finally\n$(sp)z\n$(sp)end" - ) == "try\n x\ncatch\n y\nelse\n z\nfinally\n z\nend" - # try-catch(err)-else-finally-end - @test format_string( - "try\n$(sp)x\n$(sp)catch err\n$(sp)y\n$(sp)else\n$(sp)z\n$(sp)finally\n$(sp)z\n$(sp)end" - ) == "try\n x\ncatch err\n y\nelse\n z\nfinally\n z\nend" - end + # try-catch-else-end + @test format_string( + "try\n$(sp)x\n$(sp)catch\n$(sp)y\n$(sp)else\n$(sp)z\n$(sp)end" + ) == "try\n x\ncatch\n y\nelse\n z\nend" + # try-catch(err)-else-end + @test format_string( + "try\n$(sp)x\n$(sp)catch err\n$(sp)y\n$(sp)else\n$(sp)z\n$(sp)end" + ) == "try\n x\ncatch err\n y\nelse\n z\nend" + # try-catch-else-finally-end + @test format_string( + "try\n$(sp)x\n$(sp)catch\n$(sp)y\n$(sp)else\n$(sp)z\n$(sp)finally\n$(sp)z\n$(sp)end" + ) == "try\n x\ncatch\n y\nelse\n z\nfinally\n z\nend" + # try-catch(err)-else-finally-end + @test format_string( + "try\n$(sp)x\n$(sp)catch err\n$(sp)y\n$(sp)else\n$(sp)z\n$(sp)finally\n$(sp)z\n$(sp)end" + ) == "try\n x\ncatch err\n y\nelse\n z\nfinally\n z\nend" # do-end @test format_string("open() do\n$(sp)a\n$(sp)end") == "open() do\n a\nend" @test format_string("open() do io\n$(sp)a\n$(sp)end") == "open() do io\n a\nend" @@ -768,9 +766,7 @@ end @test format_string("a $(d)+\n$(sp)b") == "a $(d)+\n b" @test format_string("a $(d)+ b $(d)*\n$(sp)c") == "a $(d)+ b $(d)*\n c" @test format_string("a $(d)+\n$(sp)b $(d)*\n$(sp)c") == "a $(d)+\n b $(d)*\n c" - if !(VERSION < v"1.7" && d == ".") - @test format_string("a $(d)||\n$(sp)b") == "a $(d)||\n b" - end + @test format_string("a $(d)||\n$(sp)b") == "a $(d)||\n b" end # assignment for nl in ("\n", "\n\n") @@ -1070,20 +1066,18 @@ end # try-finally-catch(err)-end @test format_string("try$(d)x$(d)finally$(d)y$(d)catch err$(d)z$(d)end") == "try\n x\nfinally\n y\ncatch err\n z\nend" - if VERSION >= v"1.8" - # try-catch-else-end - @test format_string("try$(d)x$(d)catch\ny$(d)else$(d)z$(d)end") == - "try\n x\ncatch\n y\nelse\n z\nend" - # try-catch(err)-else-end - @test format_string("try$(d)x$(d)catch err$(d)y$(d)else$(d)z$(d)end") == - "try\n x\ncatch err\n y\nelse\n z\nend" - # try-catch-else-finally-end - @test format_string("try$(d)x$(d)catch\ny$(d)else$(d)z$(d)finally$(d)z$(d)end") == - "try\n x\ncatch\n y\nelse\n z\nfinally\n z\nend" - # try-catch(err)-else-finally-end - @test format_string("try$(d)x$(d)catch err$(d)y$(d)else$(d)z$(d)finally$(d)z$(d)end") == - "try\n x\ncatch err\n y\nelse\n z\nfinally\n z\nend" - end + # try-catch-else-end + @test format_string("try$(d)x$(d)catch\ny$(d)else$(d)z$(d)end") == + "try\n x\ncatch\n y\nelse\n z\nend" + # try-catch(err)-else-end + @test format_string("try$(d)x$(d)catch err$(d)y$(d)else$(d)z$(d)end") == + "try\n x\ncatch err\n y\nelse\n z\nend" + # try-catch-else-finally-end + @test format_string("try$(d)x$(d)catch\ny$(d)else$(d)z$(d)finally$(d)z$(d)end") == + "try\n x\ncatch\n y\nelse\n z\nfinally\n z\nend" + # try-catch(err)-else-finally-end + @test format_string("try$(d)x$(d)catch err$(d)y$(d)else$(d)z$(d)finally$(d)z$(d)end") == + "try\n x\ncatch err\n y\nelse\n z\nfinally\n z\nend" # do-end @test format_string("open() do\na$(d)end") == "open() do\n a\nend" @test format_string("open() do\nend") == "open() do\nend"