Skip to content

Commit 2fb9f5d

Browse files
committed
Fix version (1.13) and tests
1 parent d0cdf29 commit 2fb9f5d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/parser.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -3627,7 +3627,7 @@ function parse_atom(ps::ParseState, check_identifiers=true, has_unary_prefix=fal
36273627
elseif check_identifiers && is_closing_token(ps, leading_kind)
36283628
# :(end) ==> (quote-: (error end))
36293629
bump(ps, error="invalid identifier")
3630-
elseif ps.end_symbol && leading_kind in KSet"begin end" && ps.stream.version >= (1, 12)
3630+
elseif ps.end_symbol && leading_kind in KSet"begin end" && ps.stream.version >= (1, 13)
36313631
# https://github.com/JuliaLang/julia/issues/57269
36323632
# Parse a[begin] differently from a[var"begin"]
36333633
bump(ps)

test/parser.jl

+9-4
Original file line numberDiff line numberDiff line change
@@ -1156,14 +1156,19 @@ parsestmt_with_kind_tests = [
11561156
"a >>= b" => "(op= a::Identifier >>::Identifier b::Identifier)"
11571157
":+=" => "(quote-: +=::op=)"
11581158
":.+=" => "(quote-: (. +=::op=))"
1159-
# TODO: specify version 1.12
1160-
# "a[begin]" => "(ref a::Identifier begin::begin)"
1161-
# "a[end]" => "(ref a::Identifier end::end)"
1159+
((v=v"1.13",), "a[begin]") => "(ref a::Identifier begin::begin)"
1160+
((v=v"1.13",), "a[end]") => "(ref a::Identifier end::end)"
11621161
]
11631162

11641163
@testset "parser `Kind` remapping" begin
11651164
@testset "$(repr(input))" for (input, output) in parsestmt_with_kind_tests
1166-
input = ((show_kind=true,), input)
1165+
if !(input isa AbstractString)
1166+
opts, input_s = input
1167+
else
1168+
opts = NamedTuple()
1169+
input_s = input
1170+
end
1171+
input = ((show_kind=true, opts...), input_s)
11671172
test_parse(JuliaSyntax.parse_stmts, input, output)
11681173
end
11691174
end

0 commit comments

Comments
 (0)