Browse Source

Require Julia version 1.10

pull/66/head
Fredrik Ekre 1 year ago
parent
commit
49a09b929f
No known key found for this signature in database
GPG Key ID: DE82E6D5E364C0A2
  1. 5
      .github/workflows/Check.yml
  2. 5
      .github/workflows/Test.yml
  3. 1
      Project.toml
  4. 17
      src/Runic.jl
  5. 5
      src/debug.jl
  6. 7
      src/main.jl
  7. 6
      test/runtests.jl

5
.github/workflows/Check.yml

@ -17,10 +17,7 @@ jobs: @@ -17,10 +17,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1.7'
- '1.8'
- '1.9'
- '1.10'
- '1'
- 'nightly'
env:

5
.github/workflows/Test.yml

@ -17,10 +17,7 @@ jobs: @@ -17,10 +17,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1.7'
- '1.8'
- '1.9'
- '1.10'
- '1'
- 'nightly'
os:

1
Project.toml

@ -9,6 +9,7 @@ Preferences = "21216c6a-2e73-6563-6e65-726566657250" @@ -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"

17
src/Runic.jl

@ -5,15 +5,6 @@ module Runic @@ -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 @@ -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

5
src/debug.jl

@ -4,11 +4,6 @@ @@ -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")

7
src/main.jl

@ -1,10 +1,7 @@ @@ -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

6
test/runtests.jl

@ -627,7 +627,6 @@ end @@ -627,7 +627,6 @@ 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"
@ -644,7 +643,6 @@ end @@ -644,7 +643,6 @@ 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
# 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,10 +766,8 @@ end @@ -768,10 +766,8 @@ 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
end
# assignment
for nl in ("\n", "\n\n")
# Regular line continuation of newlines between `=` and rhs
@ -1070,7 +1066,6 @@ end @@ -1070,7 +1066,6 @@ 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"
@ -1083,7 +1078,6 @@ end @@ -1083,7 +1078,6 @@ end
# 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
# do-end
@test format_string("open() do\na$(d)end") == "open() do\n a\nend"
@test format_string("open() do\nend") == "open() do\nend"

Loading…
Cancel
Save