Running julia parsererr2.jl
(with parsererr2.jl as shown later) produces a proper error message* about a misplaced bracket:
ERROR: LoadError: syntax: missing last argument in "w[4]:" range expression
Stacktrace:
[1] top-level scope
@ ... /parsererr2.jl:10
in expression starting at ... /parsererr2.jl:10
*Message shown with file path redacted
Here is the program:
module d6
mutable struct SE
w ::String
vb ::Int
ve ::Int
end
vv(s) = 5
function main()
wi=["aaaa", "bbbb",]
wo = [SE(w, vv(w), vv(w[4]:end)) for w in sort(unique(wi))]
end
main()
end # module
Note, julia --version
shows julia version 1.9.2
and julia-latest --version
shows julia version 1.11.0-DEV
on my ubuntu.22.04 linux system.
Running julia-latest parsererr2.jl
with the wo =
line split via a newline before for
results in an error message with mostly the same content as julia version 1.9.2’s message (with 2 context lines and a header line added). Without that newline, julia-latest parsererr2.jl
produces an anomalous error message which includes an exception report and quotes the whole program:
┌ Error: JuliaSyntax parser failed — falling back to flisp!
│ exception = (BoundsError(Any[], (1,)), Union{Ptr{Nothing}, Base.InterpreterIP}[Ptr{Nothing} @0x00007ff209c3b5ec, Ptr{Nothing} @0x00007ff1f7d21d17, Ptr{Nothing} @0x00007ff1f73ff479, Ptr{Nothing} @0x00007ff1f73fefa4, Ptr{Nothing} @0x00007ff1f73fefa4, Ptr{Nothing} @0x00007ff1f774659f, Ptr{Nothing} @0x00007ff1f83a3e50, Ptr{Nothing} @0x00007ff1f7682b5c, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff209bc6329, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff209bc83e8, Ptr{Nothing} @0x00007ff1f7439d43, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff209bc83e8, Ptr{Nothing} @0x00007ff1f763b2ca, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff209bc83e8, Ptr{Nothing} @0x00007ff1f7ab5dcd, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff209bc83e8, Ptr{Nothing} @0x00007ff1f8143201, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff1f787d243, Ptr{Nothing} @0x00007ff1f7c075d6, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff1f7ad4723, Ptr{Nothing} @0x00007ff1f789abcd, Ptr{Nothing} @0x00007ff1f7df648a, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff1f7ca64e5, Ptr{Nothing} @0x00007ff1f7c98972, Ptr{Nothing} @0x00007ff1f820ed83, Ptr{Nothing} @0x00007ff209bb5ccd, Ptr{Nothing} @0x00007ff209c24012, Ptr{Nothing} @0x00007ff209c24aee, Ptr{Nothing} @0x0000000000401088, Ptr{Nothing} @0x00007ff20a79bd8f, Ptr{Nothing} @0x00007ff20a79be3f, Ptr{Nothing} @0x00000000004010b8])
│ offset = 0
│ code = module d6
mutable struct SE
w ::String
vb ::Int
ve ::Int
end
vv(s) = 5
function main()
wi=["aaaa", "bbbb",]
wo = [SE(w, vv(w), vv(w[4]:end)) for w in sort(unique(wi))]
end
main()
end # module
â”” @ Base.JuliaSyntax /cache/build/default-amdci4-1/julialang/julia-master/base/JuliaSyntax/src/hooks.jl:258
ERROR: LoadError: syntax: missing last argument in "w[4]:" range expression
Stacktrace:
[1] top-level scope
@ ... /parsererr2.jl:10
in expression starting at ... /parsererr2.jl:10